Skip to content

BaseBrush

See

demo

Extended by

Constructors

new BaseBrush()

new BaseBrush(canvas): BaseBrush

Parameters

canvas: Canvas

Returns

BaseBrush

Defined in

src/brushes/BaseBrush.ts:75

Properties

canvas

canvas: Canvas

Todo

add type

Defined in

src/brushes/BaseBrush.ts:73


color

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

Color of a brush

Default

Defined in

src/brushes/BaseBrush.ts:16


limitedToCanvasSize

limitedToCanvasSize: boolean = false

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

Default

false

Defined in

src/brushes/BaseBrush.ts:68


shadow

shadow: null | Shadow = null

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

Defined in

src/brushes/BaseBrush.ts:32


strokeDashArray

strokeDashArray: null | number[] = null

Stroke Dash Array.

Default

Defined in

src/brushes/BaseBrush.ts:60


strokeLineCap

strokeLineCap: CanvasLineCap = 'round'

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

Default

Defined in

src/brushes/BaseBrush.ts:39


strokeLineJoin

strokeLineJoin: CanvasLineJoin = 'round'

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

Default

Defined in

src/brushes/BaseBrush.ts:46


strokeMiterLimit

strokeMiterLimit: number = 10

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

Default

Defined in

src/brushes/BaseBrush.ts:53


width

width: number = 1

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

Default

Defined in

src/brushes/BaseBrush.ts:23

Methods

_render()

abstract _render(): void

Returns

void

Defined in

src/brushes/BaseBrush.ts:79


onMouseDown()

abstract onMouseDown(pointer, ev): void

Parameters

pointer: Point

ev: TBrushEventData

Returns

void

Defined in

src/brushes/BaseBrush.ts:80


onMouseMove()

abstract onMouseMove(pointer, ev): void

Parameters

pointer: Point

ev: TBrushEventData

Returns

void

Defined in

src/brushes/BaseBrush.ts:81


onMouseUp()

abstract onMouseUp(ev): boolean | void

Parameters

ev: TBrushEventData

Returns

boolean | void

true if brush should continue blocking interaction

Defined in

src/brushes/BaseBrush.ts:85