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: