rememberTransformableState

Composable Function
Common
Deprecated Prefer remembering a TransformableState with a onTransformation lambda that takes the centroid. This centroid (if specified) is the point at which zooming or rotation should happen around which allows for more natural transformations.
@Composable
fun rememberTransformableState(
    onTransformation: (zoomChange: Float, panChange: Offset, rotationChange: Float) -> Unit
): TransformableState

Create and remember default implementation of TransformableState interface that contains necessary information about the ongoing transformations and provides smooth transformation capabilities.

This is the simplest way to set up a transformable modifier. When constructing this TransformableState, you must provide a onTransformation lambda, which will be invoked whenever pan, zoom or rotation happens (by gesture input or any TransformableState.transform call) with the deltas from the previous event.

Parameters

onTransformation callback invoked when transformation occurs. The callback receives the change from the previous event. It's relative scale multiplier for zoom, Offset in pixels for pan and degrees for rotation. Callers should update their state in this lambda.
Common
@Composable
fun rememberTransformableState(
    onTransformation:
        (centroid: Offset, zoomChange: Float, panChange: Offset, rotationChange: Float) -> Unit
): TransformableState

Create and remember default implementation of TransformableState interface that contains necessary information about the ongoing transformations and provides smooth transformation capabilities.

This is the simplest way to set up a transformable modifier. When constructing this TransformableState, you must provide a onTransformation lambda, which will be invoked whenever pan, zoom or rotation happens (by gesture input or any TransformableState.transform call) with the deltas from the previous event.

Parameters

onTransformation callback invoked when transformation occurs. The callback receives the change from the previous event. The centroid Offset refers to where the transformation occurs. The changes are a relative scale multiplier for zoom, Offset in pixels for pan and degrees for rotation. Callers should update their state in this lambda.