Skip to main content

Interface: IPositionable

Defined in: packages/blockly/core/interfaces/i_positionable.ts:16

Interface for a component that is positioned on top of the workspace.

Extends

Properties index

PropertyDescription
idThe unique ID for this component that is used to register with the ComponentManager.

Methods index

MethodDescription
positionPositions the element. Called when the window is resized.
getBoundingRectangleReturns the bounding rectangle of the UI element in pixel units relative to the Blockly injection div.

Properties

id

id: string;

Defined in: packages/blockly/core/interfaces/i_component.ts:18

The unique ID for this component that is used to register with the ComponentManager.

Inherited from

IComponent.id

Methods

position()

position(metrics, savedPositions): void;

Defined in: packages/blockly/core/interfaces/i_positionable.ts:23

Positions the element. Called when the window is resized.

Parameters

ParameterTypeDescription
metricsUiMetricsThe workspace metrics.
savedPositionsRect[]List of rectangles that are already on the workspace.

Returns

void


getBoundingRectangle()

getBoundingRectangle(): Rect | null;

Defined in: packages/blockly/core/interfaces/i_positionable.ts:32

Returns the bounding rectangle of the UI element in pixel units relative to the Blockly injection div.

Returns

Rect | null

The UI elements's bounding box. Null if bounding box should be ignored by other UI elements.