Class: ZoomControls

Constructor

ZoomControls

new ZoomControls(workspace)

Class for a zoom controls.

Parameter

workspace

Blockly.WorkspaceSvg

The workspace to sit in.

Value must not be null.

Implements
Blockly.IPositionable

Methods

createDom

createDom() returns SVGElement

Create the zoom controls.

Returns

non-null SVGElement The zoom controls SVG group.

dispose

dispose()

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

getBoundingRectangle

getBoundingRectangle() returns Blockly.utils.Rect

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

Implements
Blockly.IPositionable#getBoundingRectangle
Returns

non-null Blockly.utils.Rect The plugin’s bounding box.

init

init(verticalSpacing) returns number

Initialize the zoom controls.

Parameter

verticalSpacing

number

Vertical distances from workspace edge to the same edge of the controls.

Returns

number Vertical distance from workspace edge to the opposite edge of the controls.

position

position(metrics, savedPositions)

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

Parameter

metrics

Blockly.MetricsManager.UiMetrics

The workspace metrics.

Value must not be null.

savedPositions

Array of non-null Blockly.utils.Rect

List of rectangles that are already on the workspace.

Value must not be null.

Implements
Blockly.IPositionable#position