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


<a id='references'></a>


<h2 id="calculatecentroid-usecurrent">calculateCentroid</h2>

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


```kotlin
fun PointerEvent.calculateCentroid(useCurrent: Boolean = true): Offset
```


Returns the centroid of all pointers that are down and were previously down. If no pointers are
down, `Offset.Unspecified` is returned. If `useCurrent` is `true`, the centroid of the
`PointerInputChange.position` is returned and if `false`, the centroid of the
`PointerInputChange.previousPosition` is returned. Only pointers that are down in both the
previous and current state are used to calculate the centroid.

Example Usage: