---
title: "animateZoomBy"
description: "Animate zoom by a ratio of [zoomFactor] over the current size and suspend until its finished."
type: "function"
---

<div class='type'>Function</div>


<a id='references'></a>
<div class='sourceset sourceset-common'>Common</div>


> **Deprecated** Maintained for binary compatibility

```kotlin
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 |




<div class='sourceset sourceset-common'>Common</div>


```kotlin
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`. |




