Skip to main content

Class: ZoomControls

Defined in: packages/blockly/core/zoom_controls.ts:323

Class for a zoom controls.

Implements​

Properties index​

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

Methods index​

MethodDescription
createDomCreate the zoom controls.
initInitializes the zoom controls.
disposeDisposes of this zoom controls. Unlink from all DOM elements to prevent memory leaks.
getBoundingRectangleReturns the bounding rectangle of the UI element in pixel units relative to the Blockly injection div.
positionPositions the zoom controls. It is positioned in the opposite corner to the corner the categories/toolbox starts at.

Constructors​

Constructor​

new ZoomControls(workspace): ZoomControls;

Defined in: packages/blockly/core/zoom_controls.ts:372

Parameters​

ParameterTypeDescription
workspaceWorkspaceSvgThe workspace to sit in.

Returns​

ZoomControls

Properties​

id​

id: string = 'zoomControls';

Defined in: packages/blockly/core/zoom_controls.ts:328

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

Implementation of​

IPositionable.id

Methods​

createDom()​

createDom(): SVGElement;

Defined in: packages/blockly/core/zoom_controls.ts:379

Create the zoom controls.

Returns​

SVGElement

The zoom controls SVG group.


init()​

init(): void;

Defined in: packages/blockly/core/zoom_controls.ts:396

Initializes the zoom controls.

Returns​

void


dispose()​

dispose(): void;

Defined in: packages/blockly/core/zoom_controls.ts:409

Disposes of this zoom controls. Unlink from all DOM elements to prevent memory leaks.

Returns​

void


getBoundingRectangle()​

getBoundingRectangle(): Rect | null;

Defined in: packages/blockly/core/zoom_controls.ts:426

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.

Implementation of​

IPositionable.getBoundingRectangle


position()​

position(metrics, savedPositions): void;

Defined in: packages/blockly/core/zoom_controls.ts:444

Positions the zoom controls. It is positioned in the opposite corner to the corner the categories/toolbox starts at.

Parameters​

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

Returns​

void

Implementation of​

IPositionable.position