🌈 Create new beautiful Compose Gradients with our new wesite ->
Function

withSave

Saves a copy of the current transform and clip on the save stack and executes the provided lambda with the current transform applied.

withSave

Source set: Common
public inline fun Canvas.withSave(block: () -> Unit)

Saves a copy of the current transform and clip on the save stack and executes the provided lambda with the current transform applied. Once the lambda has been executed, the transformation is popped from the stack, undoing the transformation.

See also:

Canvas.saveLayer, which does the same thing but additionally also groups the commands