Contents

clip

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

Declaration

void clip(
    DOMPath path, 
    optional CanvasWindingRule winding
);

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)