---
title: "clipRect"
description: "Reduces the clip region to the intersection of the current clip and the given rectangle indicated
by the given left, top, right and bottom bounds. This provides a callback to issue drawing
commands within the clipped region. After this method is invoked, this clip is no longer applied.

Use [ClipOp.Difference] to subtract the provided rectangle from the current clip."
type: "function"
---

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


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


```kotlin
inline fun DrawScope.clipRect(
    left: Float = 0.0f,
    top: Float = 0.0f,
    right: Float = size.width,
    bottom: Float = size.height,
    clipOp: ClipOp = ClipOp.Intersect,
    block: DrawScope.() -> Unit,
) = withTransform({ clipRect(left, top, right, bottom, clipOp) }, block)
```


Reduces the clip region to the intersection of the current clip and the given rectangle indicated
by the given left, top, right and bottom bounds. This provides a callback to issue drawing
commands within the clipped region. After this method is invoked, this clip is no longer applied.

Use `ClipOp.Difference` to subtract the provided rectangle from the current clip.

#### Parameters

| | |
| --- | --- |
| left | Left bound of the rectangle to clip |
| top | Top bound of the rectangle to clip |
| right | Right bound of the rectangle to clip |
| bottom | Bottom bound of the rectangle to clip |
| clipOp | Clipping operation to conduct on the given bounds, defaults to `ClipOp.Intersect` |
| block | Lambda callback with this CanvasScope as a receiver scope to issue drawing commands within the provided clip |




