isolated
Executes a given function within an isolated context where transforms and styles are managed. Ensures that the applied transforms and styles are reverted after the function execution, maintaining isolation for the block of code.
Usage example:
drawer.fill = ColorRGBa.PINK
drawer.isolated {
drawer.fill = ColorRGBa.BLACK
drawer.translate(100.0, 100.0)
drawer.circle(0.0, 0.0, 50.0)
}
// fill is PINK and translation is reset
drawer.circle(0.0, 0.0, 50.0)Content copied to clipboard
Parameters
function
A lambda function that operates within the isolated drawing context.