blocksuite/docs/api/@blocksuite/std/gfx/classes/GfxBlockElementModel.md
BlockSuite API Documentation / @blocksuite/std / gfx / GfxBlockElementModel
The graphic block model that can be rendered in the graphics mode.
All the graphic block model should extend this class.
You can use GfxCompatibleBlockModel to convert a BlockModel to a subclass that extends it.
BlockModel<Props>Props extends GfxCompatibleProps = GfxCompatibleProps
responseExtension: [
number,number]
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 [x, y, width, height].
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, width + 2 * horizontal, height + 2 * vertical].
Example:
[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.GfxCompatibleInterface.responseExtension
get elementBound():
Bound
The bound of the element without considering the response extension.
Bound
The bound of the element without considering the response extension.
GfxCompatibleInterface.elementBound
get lockedBySelf():
boolean|undefined
Indicates whether the current block is explicitly locked by self.
For checking the lock status of the element, use isLocked instead.
For (un)locking the element, use (un)lock instead.
boolean | undefined
set lockedBySelf(
lockedBySelf):void
Indicates whether the current block is explicitly locked by self.
For checking the lock status of the element, use isLocked instead.
For (un)locking the element, use (un)lock instead.
boolean | undefined
void
Indicates whether the current block is explicitly locked by self.
For checking the lock status of the element, use isLocked instead.
For (un)locking the element, use (un)lock instead.
GfxCompatibleInterface.lockedBySelf
get responseBound():
Bound
The bound of the element considering the response extension.
Bound
The bound of the element considering the response extension.
GfxCompatibleInterface.responseBound
isLocked():
boolean
Check if the element is locked. It will check the lock status of the element and its ancestors.
boolean