rememberTransformableState
Composable Function
Common
@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. |