rotateRad

Function

Common
fun Canvas.rotateRad(radians: Float, pivotX: Float = 0.0f, pivotY: Float = 0.0f)

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

Parameters

radiansRotation transform to apply to the Canvas
pivotXThe x-coord for the pivot point
pivotYThe y-coord for the pivot point
Common
inline fun DrawTransform.rotateRad(radians: Float, pivot: Offset = center) =
    rotate(degrees(radians), pivot)

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

Parameters

radiansto rotate clockwise
pivotThe coordinate for the pivot point, defaults to the center of the coordinate space
Common
inline fun DrawScope.rotateRad(
    radians: Float,
    pivot: Offset = center,
    block: DrawScope.() -> Unit,
)

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

Parameters

radiansto rotate clockwise
pivotThe coordinate for the pivot point, defaults to the center of the coordinate space
blocklambda that is called to issue drawing commands within the rotated coordinate space