Function

animateZoomBy

Animate zoom by a ratio of [zoomFactor] over the current size and suspend until its finished.

Common
Deprecated Maintained for binary compatibility

animateZoomBy

suspend fun TransformableState.animateZoomBy(
    zoomFactor: Float,
    animationSpec: AnimationSpec<Float> = SpringSpec(stiffness = Spring.StiffnessLow),
) =
    animateZoomBy(
        zoomFactor = zoomFactor,
        animationSpec = animationSpec,
        centroid = Offset.Unspecified,
    )

Animate zoom by a ratio of zoomFactor over the current size and suspend until its finished.

Parameters

zoomFactor ratio over the current size by which to zoom. For example, if zoomFactor is 3f, zoom will be increased 3 fold from the current value.
animationSpec AnimationSpec to be used for animation

animateZoomBy

Common
suspend fun TransformableState.animateZoomBy(
    zoomFactor: Float,
    animationSpec: AnimationSpec<Float> = SpringSpec(stiffness = Spring.StiffnessLow),
    centroid: Offset = Offset.Unspecified,
)

Animate zoom by a ratio of zoomFactor over the current size and suspend until its finished.

Parameters

zoomFactor ratio over the current size by which to zoom. For example, if zoomFactor is 3f, zoom will be increased 3 fold from the current value.
animationSpec AnimationSpec to be used for animation
centroid the Offset around which the zoom should occur, if any. The default value is Offset.Unspecified, which leaves the behavior up to the implementation of the TransformableState.