Skip to content

BaseBrush

Defined in: src/brushes/BaseBrush.ts:10

See

demo

Extended by

Constructors

new BaseBrush()

new BaseBrush(canvas): BaseBrush

Defined in: src/brushes/BaseBrush.ts:75

Parameters

canvas

Canvas

Returns

BaseBrush

Properties

canvas

canvas: Canvas

Defined in: src/brushes/BaseBrush.ts:73

Todo

add type


color

color: string = 'rgb(0, 0, 0)'

Defined in: src/brushes/BaseBrush.ts:16

Color of a brush

Default


limitedToCanvasSize

limitedToCanvasSize: boolean = false

Defined in: src/brushes/BaseBrush.ts:68

When true, the free drawing is limited to the whiteboard size. Default to false.

Default

false

shadow

shadow: null | Shadow = null

Defined in: src/brushes/BaseBrush.ts:32

Shadow object representing shadow of this shape. Backwards incompatibility note: This property replaces “shadowColor” (String), “shadowOffsetX” (Number), “shadowOffsetY” (Number) and “shadowBlur” (Number) since v1.2.12

Default


strokeDashArray

strokeDashArray: null | number[] = null

Defined in: src/brushes/BaseBrush.ts:60

Stroke Dash Array.

Default


strokeLineCap

strokeLineCap: CanvasLineCap = 'round'

Defined in: src/brushes/BaseBrush.ts:39

Line endings style of a brush (one of “butt”, “round”, “square”)

Default


strokeLineJoin

strokeLineJoin: CanvasLineJoin = 'round'

Defined in: src/brushes/BaseBrush.ts:46

Corner style of a brush (one of “bevel”, “round”, “miter”)

Default


strokeMiterLimit

strokeMiterLimit: number = 10

Defined in: src/brushes/BaseBrush.ts:53

Maximum miter length (used for strokeLineJoin = “miter”) of a brush’s

Default


width

width: number = 1

Defined in: src/brushes/BaseBrush.ts:23

Width of a brush, has to be a Number, no string literals

Default

Methods

_render()

abstract _render(): void

Defined in: src/brushes/BaseBrush.ts:79

Returns

void


onMouseDown()

abstract onMouseDown(pointer, ev): void

Defined in: src/brushes/BaseBrush.ts:80

Parameters

pointer

Point

ev

TBrushEventData

Returns

void


onMouseMove()

abstract onMouseMove(pointer, ev): void

Defined in: src/brushes/BaseBrush.ts:81

Parameters

pointer

Point

ev

TBrushEventData

Returns

void


onMouseUp()

abstract onMouseUp(ev): boolean | void

Defined in: src/brushes/BaseBrush.ts:85

Parameters

ev

TBrushEventData

Returns

boolean | void

true if brush should continue blocking interaction