clipPath

Function

Common
inline fun DrawScope.clipPath(
    path: Path,
    clipOp: ClipOp = ClipOp.Intersect,
    block: DrawScope.() -> Unit,
) = withTransform({ clipPath(path, clipOp) }, block)

Reduces the clip region to the intersection of the current clip and the given path. This method provides a callback to issue drawing commands within the region defined by the clipped path. After this method is invoked, this clip is no longer applied.

Parameters

pathShape to clip drawing content within
clipOpClipping operation to conduct on the given bounds, defaults to ClipOp.Intersect
blockLambda callback with this CanvasScope as a receiver scope to issue drawing commands within the provided clip