withHints

inline fun Graphics.withHints(vararg hints: Pair<RenderingHints.Key, Any>, draw: Graphics2D.() -> Unit)

Perform the specified block of drawing logic using the specified rendering hints. Restore the original rendering hints before returning control to the caller.

Receiver

A graphics context that must be a subclass of Graphics2D.

Parameters

hints

The rendering hints to use throughout the specified drawing logic.

draw

The drawing logic, i.e., how to draw while the rendering hints are active.