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
_render()
Render all spray chunks
渲染所有喷雾块
- Source:
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()
Render new chunk of spray brush
渲染新的喷雾刷块
- Source: