Canvasity.clip

Restrict the clip region by the current path.

Intersects the current clip region with the interior of the current path (the region that would be filled), and replaces the current clip region with this intersection. Subsequent calls to clip can only reduce this further. When filling or stroking, only pixels within the current clip region will change. The current path is left unchanged by updating the clip region; begin a new path to clear it. Defaults to the entire canvas.

Tip: to be able to reset the current clip region, save the canvas state first before clipping then restore the state to reset it.

Meta