DrawTransform

sealed interface DrawTransform

Defines transformations that can be applied to the canvas coordinate system within a withTransform block.

Functions

Link copied to clipboard
abstract fun clipPath(shape: Shape)

Intersects the current clip with the given shape.

Link copied to clipboard
abstract fun clipRect(x: Float, y: Float, width: Float, height: Float)

Intersects the current clip with a rectangle defined by (x, y, width, height).

Link copied to clipboard
abstract fun rotate(degrees: Float, px: Float, py: Float)

Rotates the coordinate system by degrees clockwise around pivot point (px, py).

Link copied to clipboard
abstract fun scale(scaleX: Float, scaleY: Float, px: Float, py: Float)

Scales the coordinate system by scaleX horizontally and scaleY vertically around pivot point (px, py).

Link copied to clipboard
abstract fun translate(dx: Float, dy: Float)

Translates the coordinate origin by dx horizontally and dy vertically.