---
title: "rotate"
description: "Add a rotation (in degrees clockwise) to the current transform at the given pivot point. The
pivot coordinate remains unchanged by the rotation transformation"
type: "function"
---

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


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


```kotlin
fun Canvas.rotate(degrees: Float, pivotX: Float, pivotY: Float)
```


Add a rotation (in degrees clockwise) to the current transform at the given pivot point. The
pivot coordinate remains unchanged by the rotation transformation

#### Parameters

| | |
| --- | --- |
| degrees | to rotate clockwise |
| pivotX | The x-coord for the pivot point |
| pivotY | The y-coord for the pivot point |




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


```kotlin
inline fun DrawScope.rotate(degrees: Float, pivot: Offset = center, block: DrawScope.() -> Unit) =
    withTransform({ rotate(degrees, pivot) }, block)
```


Add a rotation (in degrees clockwise) to the current transform at the given pivot point. The
pivot coordinate remains unchanged by the rotation transformation. After the provided lambda is
invoked, the rotation transformation is undone.

#### Parameters

| | |
| --- | --- |
| degrees | to rotate clockwise |
| pivot | The coordinate for the pivot point, defaults to the center of the coordinate space |
| block | lambda that is called to issue drawing commands within the rotated coordinate space |




