---
title: "zoomBy"
description: "Zoom without animation by a ratio of [zoomFactor] over the current size and suspend until it's
set."
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.zoomBy(zoomFactor: Float) =
    zoomBy(zoomFactor = zoomFactor, centroid = Offset.Unspecified)
```


Zoom without animation by a ratio of `zoomFactor` over the current size and suspend until it's
set.

#### Parameters

| | |
| --- | --- |
| zoomFactor | ratio over the current size by which to zoom |




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


```kotlin
suspend fun TransformableState.zoomBy(zoomFactor: Float, centroid: Offset = Offset.Unspecified) =
    transform {
        transformByWithCentroid(
            centroid = centroid,
            zoomChange = zoomFactor,
            panChange = Offset.Zero,
            rotationChange = 0f,
        )
    }
```


Zoom without animation by a ratio of `zoomFactor` over the current size and suspend until it's
set.

#### Parameters

| | |
| --- | --- |
| zoomFactor | ratio over the current size by which to zoom |
| 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`. |




