remember Zoom State
fun rememberZoomState(@FloatRange(from = 1.0 ) maxScale: Float = 5.0f, contentSize: Size = Size.Zero, velocityDecay: DecayAnimationSpec<Float> = exponentialDecay(), @FloatRange(from = 1.0 ) initialScale: Float = 1.0f, bounce: Bounce = Bounce.Default): ZoomState
Creates a ZoomState that is remembered across compositions.
Parameters
max Scale
The maximum scale of the content.
content Size
Size of content (i.e. image size.) If Zero, the composable layout size will be used as content size.
velocity Decay
The decay animation spec for fling behaviour.
initial Scale
The initial scale of the content.
bounce
How far the scale can go beyond its normal range during a gesture.
When maxScale, contentSize, initialScale, and bounce change, a new ZoomState instance is created, which resets the scale and the offsets. velocityDecay is only read when that happens, so changing it alone has no effect.