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

rotate

Add a rotation (in degrees clockwise) to the current transform at the given pivot point.

rotate

Source set: Common
public fun Canvas.rotate(degrees: Float, pivotX: Float, pivotY: Float)

Add a rotation (in degrees clockwise) to the current transform at the given pivot point. The pivot coordinate remains unchanged by the rotation transformation

Parameters

degrees to rotate clockwise
pivotX The x-coord for the pivot point
pivotY The y-coord for the pivot point

rotate

Source set: Common
public inline fun DrawScope.rotate(
    degrees: Float,
    pivot: Offset = center,
    block: DrawScope.() -> Unit,
): Unit

Add a rotation (in degrees clockwise) to the current transform at the given pivot point. The pivot coordinate remains unchanged by the rotation transformation. After the provided lambda is invoked, the rotation transformation is undone.

Parameters

degrees to rotate clockwise
pivot The coordinate for the pivot point, defaults to the center of the coordinate space
block lambda that is called to issue drawing commands within the rotated coordinate space