Documentation / @ripl/terminal / createClipMask
Function: createClipMask() ​
createClipMask(
contours,width,height,previous?):ClipMask
Defined in: terminal/src/clip.ts:39
Builds a clip mask covering the interior of the given contours, intersected with an existing mask.
Intersection rather than replacement is what makes nested clips behave the way they do on canvas and SVG: an inner clip narrows the outer one, it never widens it.
Parameters ​
| Parameter | Type | Description |
|---|---|---|
contours | Vertex[][] | The clip geometry, in raster space. |
width | number | Width of the raster grid. |
height | number | Height of the raster grid. |
previous? | ClipMask | null | The mask already in force, if any. |
Returns ​
The intersected mask.