new Stencil()
A stencil can be used to set the drawing region.
Stencils are treated as objects their shaphe is used to filter other objects shape.
Multiple stencil objects can be active simulatenously.
- Source:
Methods
clip(context, viewport, canvas)
Clip the canvas context, to ensure that next objects being drawn are cliped to the path stored here.
Parameters:
Name | Type | Description |
---|---|---|
context |
CanvasContext | Canvas 2d drawing context. |
viewport |
Viewport | Viewport applied to the canvas. |
canvas |
DOM | DOM canvas element where the content is being drawn. |
- Source: