SprayBrush
Defined in: src/brushes/SprayBrush.ts:31
See
Extends
Constructors
new SprayBrush()
new SprayBrush(
canvas
):SprayBrush
Defined in: src/brushes/SprayBrush.ts:83
Constructor
Parameters
canvas
Returns
Instance of a spray brush
Overrides
Properties
canvas
canvas:
Canvas
Defined in: src/brushes/BaseBrush.ts:73
Todo
add type
Inherited from
color
color:
string
='rgb(0, 0, 0)'
Defined in: src/brushes/BaseBrush.ts:16
Color of a brush
Default
Inherited from
density
density:
number
=20
Defined in: src/brushes/SprayBrush.ts:44
Density of a spray (number of dots per chunk)
Default
dotWidth
dotWidth:
number
=1
Defined in: src/brushes/SprayBrush.ts:51
Width of spray dots
Default
dotWidthVariance
dotWidthVariance:
number
=1
Defined in: src/brushes/SprayBrush.ts:58
Width variance of spray dots
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
Inherited from
optimizeOverlapping
optimizeOverlapping:
boolean
=true
Defined in: src/brushes/SprayBrush.ts:72
Whether overlapping dots (rectangles) should be removed (for performance reasons)
Default
randomOpacity
randomOpacity:
boolean
=false
Defined in: src/brushes/SprayBrush.ts:65
Whether opacity of a dot should be random
Default
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
Inherited from
strokeDashArray
strokeDashArray:
null
|number
[] =null
Defined in: src/brushes/BaseBrush.ts:60
Stroke Dash Array.
Default
Inherited from
strokeLineCap
strokeLineCap:
CanvasLineCap
='round'
Defined in: src/brushes/BaseBrush.ts:39
Line endings style of a brush (one of “butt”, “round”, “square”)
Default
Inherited from
strokeLineJoin
strokeLineJoin:
CanvasLineJoin
='round'
Defined in: src/brushes/BaseBrush.ts:46
Corner style of a brush (one of “bevel”, “round”, “miter”)
Default
Inherited from
strokeMiterLimit
strokeMiterLimit:
number
=10
Defined in: src/brushes/BaseBrush.ts:53
Maximum miter length (used for strokeLineJoin = “miter”) of a brush’s
Default
Inherited from
width
width:
number
=10
Defined in: src/brushes/SprayBrush.ts:37
Width of a spray
Default
Overrides
Methods
_render()
_render():
void
Defined in: src/brushes/SprayBrush.ts:177
Render all spray chunks
Returns
void
Overrides
addSprayChunk()
addSprayChunk(
pointer
):void
Defined in: src/brushes/SprayBrush.ts:192
Parameters
pointer
Returns
void
onMouseDown()
onMouseDown(
pointer
):void
Defined in: src/brushes/SprayBrush.ts:93
Invoked on mouse down
Parameters
pointer
Returns
void
Overrides
onMouseMove()
onMouseMove(
pointer
):void
Defined in: src/brushes/SprayBrush.ts:106
Invoked on mouse move
Parameters
pointer
Returns
void
Overrides
onMouseUp()
onMouseUp():
void
Defined in: src/brushes/SprayBrush.ts:117
Invoked on mouse up
Returns
void
Overrides
renderChunck()
renderChunck(
sprayChunck
):void
Defined in: src/brushes/SprayBrush.ts:159
Parameters
sprayChunck
Returns
void