---
title: "animatePanBy"
description: "Animate pan by [offset] Offset in pixels 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.animatePanBy(
    offset: Offset,
    animationSpec: AnimationSpec<Offset> = SpringSpec(stiffness = Spring.StiffnessLow),
) = animatePanBy(offset = offset, animationSpec = animationSpec, centroid = Offset.Unspecified)
```


Animate pan by `offset` Offset in pixels and suspend until its finished

#### Parameters

| | |
| --- | --- |
| offset | offset to pan, in pixels |
| animationSpec | `AnimationSpec` to be used for pan animation |




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


```kotlin
suspend fun TransformableState.animatePanBy(
    offset: Offset,
    animationSpec: AnimationSpec<Offset> = SpringSpec(stiffness = Spring.StiffnessLow),
    centroid: Offset = Offset.Unspecified,
)
```


Animate pan by `offset` Offset in pixels and suspend until its finished

#### Parameters

| | |
| --- | --- |
| offset | offset to pan, in pixels |
| animationSpec | `AnimationSpec` to be used for pan animation |
| centroid | the `Offset` around which the pan should occur, if any. The default value is `Offset.Unspecified`, which leaves the behavior up to the implementation of the `TransformableState`. |




