Deprecated Maintained for binary compatibility
animateBy
suspend fun TransformableState.animateBy(
zoomFactor: Float,
panOffset: Offset,
rotationDegrees: Float,
zoomAnimationSpec: AnimationSpec<Float> = SpringSpec(stiffness = Spring.StiffnessLow),
panAnimationSpec: AnimationSpec<Offset> = SpringSpec(stiffness = Spring.StiffnessLow),
rotationAnimationSpec: AnimationSpec<Float> = SpringSpec(stiffness = Spring.StiffnessLow),
) =
animateBy(
zoomFactor = zoomFactor,
panOffset = panOffset,
rotationDegrees = rotationDegrees,
zoomAnimationSpec = zoomAnimationSpec,
panAnimationSpec = panAnimationSpec,
rotationAnimationSpec = rotationAnimationSpec,
centroid = Offset.Unspecified,
)
Animate zoom, pan, and rotation simultaneously and suspend until the animation is finished.
Zoom is animated by a ratio of zoomFactor over the current size. Pan is animated by panOffset in pixels. Rotation is animated by the value of rotationDegrees clockwise. Any of these parameters can be set to a no-op value that will result in no animation of that parameter. The no-op values are the following: 1f for zoomFactor, Offset.Zero for panOffset, and 0f for rotationDegrees.
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. |
| panOffset | offset to pan, in pixels |
| rotationDegrees | the degrees by which to rotate clockwise |
| zoomAnimationSpec | AnimationSpec to be used for animating zoom |
| panAnimationSpec | AnimationSpec to be used for animating offset |
| rotationAnimationSpec | AnimationSpec to be used for animating rotation |
animateBy
suspend fun TransformableState.animateBy(
zoomFactor: Float,
panOffset: Offset,
rotationDegrees: Float,
zoomAnimationSpec: AnimationSpec<Float> = SpringSpec(stiffness = Spring.StiffnessLow),
panAnimationSpec: AnimationSpec<Offset> = SpringSpec(stiffness = Spring.StiffnessLow),
rotationAnimationSpec: AnimationSpec<Float> = SpringSpec(stiffness = Spring.StiffnessLow),
centroid: Offset = Offset.Unspecified,
)
Animate zoom, pan, and rotation simultaneously and suspend until the animation is finished.
Zoom is animated by a ratio of zoomFactor over the current size. Pan is animated by panOffset in pixels. Rotation is animated by the value of rotationDegrees clockwise. Any of these parameters can be set to a no-op value that will result in no animation of that parameter. The no-op values are the following: 1f for zoomFactor, Offset.Zero for panOffset, and 0f for rotationDegrees.
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. |
| panOffset | offset to pan, in pixels |
| rotationDegrees | the degrees by which to rotate clockwise |
| zoomAnimationSpec | AnimationSpec to be used for animating zoom |
| panAnimationSpec | AnimationSpec to be used for animating offset |
| rotationAnimationSpec | AnimationSpec to be used for animating rotation |
| centroid | the Offset around which the animation should occur, if any. The default value is Offset.Unspecified, which leaves the behavior up to the implementation of the TransformableState. |