Skip to content

BlockSuite API Documentation / @blocksuite/blocks / LocalShapeElementModel

Class: LocalShapeElementModel

Extends

  • GfxLocalElementModel

Constructors

new LocalShapeElementModel()

new LocalShapeElementModel(surfaceModel): LocalShapeElementModel

Parameters

surfaceModel

SurfaceBlockModel

Returns

LocalShapeElementModel

Inherited from

GfxLocalElementModel.constructor

Defined in

packages/framework/block-std/dist/gfx/model/surface/local-element-model.d.ts:34

Properties

_local

protected _local: Map<string | symbol, unknown>

Inherited from

GfxLocalElementModel._local

Defined in

packages/framework/block-std/dist/gfx/model/surface/local-element-model.d.ts:10


_props

protected _props: Set<string | symbol>

Used to store all the name of the properties that have been decorated with the @prop

Inherited from

GfxLocalElementModel._props

Defined in

packages/framework/block-std/dist/gfx/model/surface/local-element-model.d.ts:15


_surface

protected _surface: SurfaceBlockModel

Inherited from

GfxLocalElementModel._surface

Defined in

packages/framework/block-std/dist/gfx/model/surface/local-element-model.d.ts:16


cache

cache: Map<string | symbol, unknown>

used to store the properties' cache key when the properties required heavy computation

Inherited from

GfxLocalElementModel.cache

Defined in

packages/framework/block-std/dist/gfx/model/surface/local-element-model.d.ts:21


id

id: string

Inherited from

GfxLocalElementModel.id

Defined in

packages/framework/block-std/dist/gfx/model/surface/local-element-model.d.ts:22


roughness

roughness: number

Defined in

packages/affine/model/dist/elements/shape/shape.d.ts:74


textBound

textBound: null | Bound

Defined in

packages/affine/model/dist/elements/shape/shape.d.ts:75


textDisplay

textDisplay: boolean

Defined in

packages/affine/model/dist/elements/shape/shape.d.ts:76

Accessors

color

Defined in

packages/affine/model/dist/elements/shape/shape.d.ts:78


deserializedXYWH

Get Signature

get deserializedXYWH(): XYWH

Returns

XYWH

Inherited from

GfxLocalElementModel.deserializedXYWH

Defined in

packages/framework/block-std/dist/gfx/model/surface/local-element-model.d.ts:24


elementBound

Get Signature

get elementBound(): Bound

The bound of the element without considering the response extension.

Returns

Bound

Inherited from

GfxLocalElementModel.elementBound

Defined in

packages/framework/block-std/dist/gfx/model/surface/local-element-model.d.ts:25


fillColor

Defined in

packages/affine/model/dist/elements/shape/shape.d.ts:79


filled

Defined in

packages/affine/model/dist/elements/shape/shape.d.ts:80


fontFamily

Defined in

packages/affine/model/dist/elements/shape/shape.d.ts:81


fontSize

Defined in

packages/affine/model/dist/elements/shape/shape.d.ts:82


fontStyle

Defined in

packages/affine/model/dist/elements/shape/shape.d.ts:83


fontWeight

Defined in

packages/affine/model/dist/elements/shape/shape.d.ts:84


group

Get Signature

get group(): null | GfxGroupModel

Returns

null | GfxGroupModel

Inherited from

GfxLocalElementModel.group

Defined in

packages/framework/block-std/dist/gfx/model/surface/local-element-model.d.ts:26


groupId

Inherited from

GfxLocalElementModel.groupId

Defined in

packages/framework/block-std/dist/gfx/model/surface/local-element-model.d.ts:46


groups

Get Signature

get groups(): GfxGroupModel[]

Returns

GfxGroupModel[]

Inherited from

GfxLocalElementModel.groups

Defined in

packages/framework/block-std/dist/gfx/model/surface/local-element-model.d.ts:27


h

Get Signature

get h(): number

Returns

number

Inherited from

GfxLocalElementModel.h

Defined in

packages/framework/block-std/dist/gfx/model/surface/local-element-model.d.ts:28


hidden

Inherited from

GfxLocalElementModel.hidden

Defined in

packages/framework/block-std/dist/gfx/model/surface/local-element-model.d.ts:47


index

Inherited from

GfxLocalElementModel.index

Defined in

packages/framework/block-std/dist/gfx/model/surface/local-element-model.d.ts:48


opacity

Inherited from

GfxLocalElementModel.opacity

Defined in

packages/framework/block-std/dist/gfx/model/surface/local-element-model.d.ts:49


padding

Defined in

packages/affine/model/dist/elements/shape/shape.d.ts:85


radius

Defined in

packages/affine/model/dist/elements/shape/shape.d.ts:86


responseBound

Get Signature

get responseBound(): Bound

The bound of the element considering the response extension.

Returns

Bound

Inherited from

GfxLocalElementModel.responseBound

Defined in

packages/framework/block-std/dist/gfx/model/surface/local-element-model.d.ts:29


responseExtension

Defines the extension of the response area beyond the element's bounding box. This tuple specifies the horizontal and vertical margins to be added to the element's bound.

The first value represents the horizontal extension (added to both left and right sides), and the second value represents the vertical extension (added to both top and bottom sides).

The response area is computed as: [x - horizontal, y - vertical, w + 2 * horizontal, h + 2 * vertical].

Example:

  • xywh: [0, 0, 100, 100], responseExtension: [10, 20] Resulting response area: [-10, -20, 120, 140].
  • responseExtension: [0, 0] keeps the response area equal to the bounding box.

Inherited from

GfxLocalElementModel.responseExtension

Defined in

packages/framework/block-std/dist/gfx/model/surface/local-element-model.d.ts:50


rotate

Inherited from

GfxLocalElementModel.rotate

Defined in

packages/framework/block-std/dist/gfx/model/surface/local-element-model.d.ts:51


seed

Inherited from

GfxLocalElementModel.seed

Defined in

packages/framework/block-std/dist/gfx/model/surface/local-element-model.d.ts:52


shadow

Defined in

packages/affine/model/dist/elements/shape/shape.d.ts:87


shapeStyle

Defined in

packages/affine/model/dist/elements/shape/shape.d.ts:93


shapeType

Defined in

packages/affine/model/dist/elements/shape/shape.d.ts:94


strokeColor

Defined in

packages/affine/model/dist/elements/shape/shape.d.ts:95


strokeStyle

Defined in

packages/affine/model/dist/elements/shape/shape.d.ts:96


strokeWidth

Defined in

packages/affine/model/dist/elements/shape/shape.d.ts:97


surface

Get Signature

get surface(): SurfaceBlockModel

Returns

SurfaceBlockModel

Inherited from

GfxLocalElementModel.surface

Defined in

packages/framework/block-std/dist/gfx/model/surface/local-element-model.d.ts:30


text

Defined in

packages/affine/model/dist/elements/shape/shape.d.ts:98


textAlign

Defined in

packages/affine/model/dist/elements/shape/shape.d.ts:99


textVerticalAlign

Defined in

packages/affine/model/dist/elements/shape/shape.d.ts:100


type

Get Signature

get type(): string

Returns

string

Overrides

GfxLocalElementModel.type

Defined in

packages/affine/model/dist/elements/shape/shape.d.ts:77


w

Get Signature

get w(): number

Returns

number

Inherited from

GfxLocalElementModel.w

Defined in

packages/framework/block-std/dist/gfx/model/surface/local-element-model.d.ts:31


x

Get Signature

get x(): number

Returns

number

Inherited from

GfxLocalElementModel.x

Defined in

packages/framework/block-std/dist/gfx/model/surface/local-element-model.d.ts:32


xywh

Inherited from

GfxLocalElementModel.xywh

Defined in

packages/framework/block-std/dist/gfx/model/surface/local-element-model.d.ts:53


y

Get Signature

get y(): number

Returns

number

Inherited from

GfxLocalElementModel.y

Defined in

packages/framework/block-std/dist/gfx/model/surface/local-element-model.d.ts:33

Methods

containsBound()

containsBound(bounds): boolean

Parameters

bounds

Bound

Returns

boolean

Inherited from

GfxLocalElementModel.containsBound

Defined in

packages/framework/block-std/dist/gfx/model/surface/local-element-model.d.ts:35


getLineIntersections()

getLineIntersections(start, end): null | PointLocation[]

Parameters

start

IVec

end

IVec

Returns

null | PointLocation[]

Inherited from

GfxLocalElementModel.getLineIntersections

Defined in

packages/framework/block-std/dist/gfx/model/surface/local-element-model.d.ts:36


getNearestPoint()

getNearestPoint(point): IVec

Parameters

point

IVec

Returns

IVec

Inherited from

GfxLocalElementModel.getNearestPoint

Defined in

packages/framework/block-std/dist/gfx/model/surface/local-element-model.d.ts:37


getRelativePointLocation()

getRelativePointLocation(relativePoint): PointLocation

Parameters

relativePoint

IVec

Returns

PointLocation

Inherited from

GfxLocalElementModel.getRelativePointLocation

Defined in

packages/framework/block-std/dist/gfx/model/surface/local-element-model.d.ts:38


includesPoint()

includesPoint(x, y, opt, __): boolean

Parameters

x

number

y

number

opt

PointTestOptions

__

EditorHost

Returns

boolean

Inherited from

GfxLocalElementModel.includesPoint

Defined in

packages/framework/block-std/dist/gfx/model/surface/local-element-model.d.ts:39


intersectsBound()

intersectsBound(bound): boolean

Parameters

bound

Bound

Returns

boolean

Inherited from

GfxLocalElementModel.intersectsBound

Defined in

packages/framework/block-std/dist/gfx/model/surface/local-element-model.d.ts:40


isLocked()

isLocked(): boolean

Check if the element is locked. It will check the lock status of the element and its ancestors.

Returns

boolean

Inherited from

GfxLocalElementModel.isLocked

Defined in

packages/framework/block-std/dist/gfx/model/surface/local-element-model.d.ts:41


isLockedByAncestor()

isLockedByAncestor(): boolean

Returns

boolean

Inherited from

GfxLocalElementModel.isLockedByAncestor

Defined in

packages/framework/block-std/dist/gfx/model/surface/local-element-model.d.ts:42


isLockedBySelf()

isLockedBySelf(): boolean

Returns

boolean

Inherited from

GfxLocalElementModel.isLockedBySelf

Defined in

packages/framework/block-std/dist/gfx/model/surface/local-element-model.d.ts:43


lock()

lock(): void

Returns

void

Inherited from

GfxLocalElementModel.lock

Defined in

packages/framework/block-std/dist/gfx/model/surface/local-element-model.d.ts:44


unlock()

unlock(): void

Returns

void

Inherited from

GfxLocalElementModel.unlock

Defined in

packages/framework/block-std/dist/gfx/model/surface/local-element-model.d.ts:45