---
title: "rotateBy"
description: "Rotate without animation by a [degrees] degrees 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.rotateBy(degrees: Float) = rotateBy(degrees, Offset.Unspecified)
```


Rotate without animation by a `degrees` degrees and suspend until it's set.

#### Parameters

| | |
| --- | --- |
| degrees | degrees by which to rotate |




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


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


Rotate without animation by a `degrees` degrees and suspend until it's set.

#### Parameters

| | |
| --- | --- |
| degrees | degrees by which to rotate |
| centroid | the `Offset` around which the rotation should occur, if any. The default value is `Offset.Unspecified`, which leaves the behavior up to the implementation of the `TransformableState`. |




