BlockSuite API Documentation / @blocksuite/blocks / BrushElementModel
Class: BrushElementModel
Extends
GfxPrimitiveElementModel
<BrushProps
>
Constructors
new BrushElementModel()
new BrushElementModel(
options
):BrushElementModel
Parameters
• options
• options.id: string
• options.model: SurfaceBlockModel
• options.onChange
• options.stashedStore: Map
<unknown
, unknown
>
• options.yMap: YMap
<unknown
>
Returns
Inherited from
GfxPrimitiveElementModel<BrushProps>.constructor
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:68
Properties
_disposable
protected
_disposable:DisposableGroup
Inherited from
GfxPrimitiveElementModel._disposable
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:52
_id
protected
_id:string
Inherited from
GfxPrimitiveElementModel._id
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:53
_local
protected
_local:Map
<string
|symbol
,unknown
>
Inherited from
GfxPrimitiveElementModel._local
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:55
_onChange()
protected
_onChange: (payload
) =>void
Parameters
• payload
• payload.local: boolean
• payload.oldValues: Record
<string
, unknown
>
• payload.props: Record
<string
, unknown
>
Returns
void
Inherited from
GfxPrimitiveElementModel._onChange
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:56
_preserved
protected
_preserved:Map
<string
,unknown
>
Used to store a copy of data in the yMap.
Inherited from
GfxPrimitiveElementModel._preserved
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:64
_stashed
protected
_stashed:Map
<string
,unknown
>
Inherited from
GfxPrimitiveElementModel._stashed
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:65
surface
surface:
SurfaceBlockModel
Inherited from
GfxPrimitiveElementModel.surface
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:66
yMap
yMap:
YMap
<unknown
>
Inherited from
GfxPrimitiveElementModel.yMap
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:67
Accessors
color
Defined in
packages/affine/model/dist/elements/brush/brush.d.ts:27
commands
get
commands():string
The SVG path commands for the brush.
Returns
string
Defined in
packages/affine/model/dist/elements/brush/brush.d.ts:24
connectable
get
connectable():boolean
Returns
boolean
Overrides
GfxPrimitiveElementModel.connectable
Defined in
packages/affine/model/dist/elements/brush/brush.d.ts:25
deserializedXYWH
get
deserializedXYWH():XYWH
Returns
XYWH
Inherited from
GfxPrimitiveElementModel.deserializedXYWH
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:91
display
Inherited from
GfxPrimitiveElementModel.display
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:106
elementBound
get
elementBound():Bound
The bound of the element after rotation. The bound without rotation should be created by Bound.deserialize(this.xywh)
.
Returns
Bound
Inherited from
GfxPrimitiveElementModel.elementBound
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:96
externalBound
get
externalBound():null
|Bound
Returns
null
| Bound
Inherited from
GfxPrimitiveElementModel.externalBound
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:97
externalXYWH
Inherited from
GfxPrimitiveElementModel.externalXYWH
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:107
group
get
group():null
|GfxGroupLikeElementModel
<BaseElementProps
>
Returns
null
| GfxGroupLikeElementModel
<BaseElementProps
>
Inherited from
GfxPrimitiveElementModel.group
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:98
groups
get
groups():GfxGroupLikeElementModel
<BaseElementProps
>[]
Returns
GfxGroupLikeElementModel
<BaseElementProps
>[]
Inherited from
GfxPrimitiveElementModel.groups
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:99
h
get
h():number
Returns
number
Inherited from
GfxPrimitiveElementModel.h
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:100
id
get
id():string
Returns
string
Inherited from
GfxPrimitiveElementModel.id
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:101
index
Inherited from
GfxPrimitiveElementModel.index
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:108
isConnected
get
isConnected():boolean
Returns
boolean
Inherited from
GfxPrimitiveElementModel.isConnected
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:102
lineWidth
Defined in
packages/affine/model/dist/elements/brush/brush.d.ts:28
opacity
Inherited from
GfxPrimitiveElementModel.opacity
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:109
points
Defined in
packages/affine/model/dist/elements/brush/brush.d.ts:29
rotate
Overrides
GfxPrimitiveElementModel.rotate
Defined in
packages/affine/model/dist/elements/brush/brush.d.ts:30
seed
Inherited from
GfxPrimitiveElementModel.seed
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:111
type
get
type():string
Returns
string
Overrides
GfxPrimitiveElementModel.type
Defined in
packages/affine/model/dist/elements/brush/brush.d.ts:26
w
get
w():number
Returns
number
Inherited from
GfxPrimitiveElementModel.w
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:103
x
get
x():number
Returns
number
Inherited from
GfxPrimitiveElementModel.x
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:104
xywh
Overrides
GfxPrimitiveElementModel.xywh
Defined in
packages/affine/model/dist/elements/brush/brush.d.ts:31
y
get
y():number
Returns
number
Inherited from
GfxPrimitiveElementModel.y
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:105
Methods
containsBound()
containsBound(
bounds
):boolean
Parameters
• bounds: Bound
Returns
boolean
Overrides
GfxPrimitiveElementModel.containsBound
Defined in
packages/affine/model/dist/elements/brush/brush.d.ts:16
getLineIntersections()
getLineIntersections(
start
,end
):null
|PointLocation
[]
Parameters
• start: IVec
• end: IVec
Returns
null
| PointLocation
[]
Overrides
GfxPrimitiveElementModel.getLineIntersections
Defined in
packages/affine/model/dist/elements/brush/brush.d.ts:17
getNearestPoint()
getNearestPoint(
point
):IVec
Parameters
• point: IVec
Returns
IVec
Overrides
GfxPrimitiveElementModel.getNearestPoint
Defined in
packages/affine/model/dist/elements/brush/brush.d.ts:18
getRelativePointLocation()
getRelativePointLocation(
position
):PointLocation
Parameters
• position: IVec
Returns
PointLocation
Overrides
GfxPrimitiveElementModel.getRelativePointLocation
Defined in
packages/affine/model/dist/elements/brush/brush.d.ts:19
includesPoint()
includesPoint(
px
,py
,options
?):boolean
Parameters
• px: number
• py: number
• options?: PointTestOptions
Returns
boolean
Overrides
GfxPrimitiveElementModel.includesPoint
Defined in
packages/affine/model/dist/elements/brush/brush.d.ts:20
intersectsBound()
intersectsBound(
bound
):boolean
Parameters
• bound: Bound
Returns
boolean
Inherited from
GfxPrimitiveElementModel.intersectsBound
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:85
onCreated()
onCreated():
void
Returns
void
Inherited from
GfxPrimitiveElementModel.onCreated
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:86
pop()
pop(
prop
):void
Parameters
• prop: string
Returns
void
Inherited from
GfxPrimitiveElementModel.pop
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:87
serialize()
serialize():
SerializedElement
Returns
SerializedElement
Inherited from
GfxPrimitiveElementModel.serialize
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:88
stash()
stash(
prop
):void
Parameters
• prop: string
Returns
void
Inherited from
GfxPrimitiveElementModel.stash
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:89
propsToY()
static
propsToY(props
):BrushProps
Parameters
• props: BrushProps
Returns
Overrides
GfxPrimitiveElementModel.propsToY
Defined in
packages/affine/model/dist/elements/brush/brush.d.ts:15