---
title: clip
framework: webkitjs
role: symbol
role_heading: Instance Method
path: webkitjs/canvasrenderingcontext2d/1631003-clip
---

# clip

Constrains the clipping region of the canvas to the current path.

## Declaration

```data
void clip(
    DOMPath path, 
    optional CanvasWindingRule winding
);
```

## Discussion

Discussion Use this method to treat the current path as a mask for drawing operations. For example, if you call drawImage() subsequent to calling clip(), the image is clipped at the borders of the current path.

## See Also

### Creating Paths (Lines, Curves, Arcs, and Shapes)

- [beginPath](webkitjs/canvasrenderingcontext2d/1632556-beginpath.md)
- [isPointInPath](webkitjs/canvasrenderingcontext2d/1631233-ispointinpath.md)
