# Sandbox.Painter.Clip

```csharp
void Clip(Rect rect, CornerRadii corners = null)
```

Intersects subsequent drawing with a rectangle, optionally rounded like Painter.Rect.
Captures the current Transform; later transform changes do not move this clip.
Nested clips intersect with each other and the panel's CSS clip. Scope() restores the previous clip.
Empty rectangles or a collapsed transform clip all drawing.

### Parameters

- `rect` (`Rect`)
- `corners` (`CornerRadii`), default `null`

Declared in [Sandbox.Painter](/api/Sandbox.Painter).
Assembly: `Sandbox.Engine`.
