Class: SprayBrush

fabric.SprayBrush

new SprayBrush()

SprayBrush class
Source:

Members

density :Number

Density of a spray (number of dots per chunk)
Type:
  • Number
Default Value:
  • 20
Source:

dotWidth :Number

Width of spray dots
Type:
  • Number
Default Value:
  • 1
Source:

dotWidthVariance :Number

Width variance of spray dots
Type:
  • Number
Default Value:
  • 1
Source:

optimizeOverlapping :Boolean

Whether overlapping dots (rectangles) should be removed (for performance reasons)
Type:
  • Boolean
Default Value:
  • true
Source:

randomOpacity :Boolean

Whether opacity of a dot should be random
Type:
  • Boolean
Source:

width :Number

Width of a spray
Type:
  • Number
Default Value:
  • 10
Source:

Methods

addSprayChunk(pointer)

Parameters:
Name Type Description
pointer Object
Source:

initialize(canvas) → {fabric.SprayBrush}

Constructor
Parameters:
Name Type Description
canvas fabric.Canvas
Source:
Returns:
Instance of a spray brush
Type
fabric.SprayBrush

onMouseDown(pointer)

Invoked on mouse down
Parameters:
Name Type Description
pointer Object
Source:

onMouseMove(pointer)

Invoked on mouse move
Parameters:
Name Type Description
pointer Object
Source:

onMouseUp()

Invoked on mouse up
Source:

render()

Renders brush
Source: