SprayBrush
See
Extends
Constructors
new SprayBrush()
new SprayBrush(
canvas
):SprayBrush
Constructor
Parameters
• canvas: Canvas
Returns
Instance of a spray brush
Overrides
Defined in
Properties
canvas
canvas:
Canvas
Todo
add type
Inherited from
Defined in
color
color:
string
='rgb(0, 0, 0)'
Color of a brush
Default
Inherited from
Defined in
density
density:
number
=20
Density of a spray (number of dots per chunk)
Default
Defined in
dotWidth
dotWidth:
number
=1
Width of spray dots
Default
Defined in
dotWidthVariance
dotWidthVariance:
number
=1
Width variance of spray dots
Default
Defined in
limitedToCanvasSize
limitedToCanvasSize:
boolean
=false
When true
, the free drawing is limited to the whiteboard size. Default to false.
Default
Inherited from
Defined in
optimizeOverlapping
optimizeOverlapping:
boolean
=true
Whether overlapping dots (rectangles) should be removed (for performance reasons)
Default
Defined in
randomOpacity
randomOpacity:
boolean
=false
Whether opacity of a dot should be random
Default
Defined in
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
Inherited from
Defined in
strokeDashArray
strokeDashArray:
null
|number
[] =null
Stroke Dash Array.
Default
Inherited from
Defined in
strokeLineCap
strokeLineCap:
CanvasLineCap
='round'
Line endings style of a brush (one of “butt”, “round”, “square”)
Default
Inherited from
Defined in
strokeLineJoin
strokeLineJoin:
CanvasLineJoin
='round'
Corner style of a brush (one of “bevel”, “round”, “miter”)
Default
Inherited from
Defined in
strokeMiterLimit
strokeMiterLimit:
number
=10
Maximum miter length (used for strokeLineJoin = “miter”) of a brush’s
Default
Inherited from
Defined in
width
width:
number
=10
Width of a spray
Default
Overrides
Defined in
Methods
_render()
_render():
void
Render all spray chunks
Returns
void
Overrides
Defined in
addSprayChunk()
addSprayChunk(
pointer
):void
Parameters
• pointer: Point
Returns
void
Defined in
onMouseDown()
onMouseDown(
pointer
):void
Invoked on mouse down
Parameters
• pointer: Point
Returns
void
Overrides
Defined in
onMouseMove()
onMouseMove(
pointer
):void
Invoked on mouse move
Parameters
• pointer: Point
Returns
void
Overrides
Defined in
onMouseUp()
onMouseUp():
void
Invoked on mouse up
Returns
void
Overrides
Defined in
renderChunck()
renderChunck(
sprayChunck
):void
Parameters
• sprayChunck: SprayBrushPoint
[]
Returns
void