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

```kotlin
public interface OverlayClip
```

[OverlayClip](/jetpack-compose/androidx.compose.animation/animation/interfaces/SharedTransitionScope.OverlayClip) defines a specific clipping that should be applied to a `sharedBounds` or
`sharedElement` in the overlay.

## Functions

<h2 id="getclippath-sharedcontentstate-bounds-layoutdirection-density">getClipPath</h2>

```kotlin
public fun getClipPath(
            sharedContentState: SharedContentState,
            bounds: Rect,
            layoutDirection: LayoutDirection,
            density: Density,
        ): Path?
```

Creates a clip path based on current animated `bounds` of the `sharedBounds` or
`sharedElement`, their [sharedContentState](/jetpack-compose/androidx.compose.animation/animation/classes/SharedTransitionScope.SharedContentState) (to query parent state's bounds if needed),
and [layoutDirection](/jetpack-compose/androidx.compose.ui/ui-unit/classes/LayoutDirection) and [density](/jetpack-compose/androidx.compose.ui/ui-unit/interfaces/Density). The topLeft of the `bounds` is the local position of
the sharedElement/sharedBounds in the [SharedTransitionScope](/jetpack-compose/androidx.compose.animation/animation/interfaces/SharedTransitionScope).

**Important**: The returned [Path](/jetpack-compose/androidx.compose.ui/ui-graphics/interfaces/Path) needs to be offset-ed as needed such that it is in
[SharedTransitionScope.lookaheadScopeCoordinates](/jetpack-compose/androidx.compose.animation/animation/interfaces/SharedTransitionScope)'s coordinate space. For example, if the
path is created using `bounds`, it needs to be offset-ed by `bounds`.topLeft.

When implementing this method, it is recommended to modify the same [Path](/jetpack-compose/androidx.compose.ui/ui-graphics/interfaces/Path) object and
return it here, instead of creating new [Path](/jetpack-compose/androidx.compose.ui/ui-graphics/interfaces/Path)s.