# Class: BoxStencil

## BoxStencil()

#### new BoxStencil()

Box stencil can be used to clear a box mask region. It will limit the drwaing region to this box.

Source:
  - stencil/BoxStencil.js, line 15

### Extends

- Stencil

### Members

#### box

Box object containing the size of the object.

Source:
  - stencil/BoxStencil.js, line 22

#### invert

If inverted the stencil considers the outside of the box instead of the inside.

Source:
  - stencil/BoxStencil.js, line 27

### 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.

Overrides:
  - Stencil#clip
Source:
  - stencil/Stencil.js, line 32