Blockly. ZoomControls
Class for a zoom controls.
Constructor
ZoomControls
new ZoomControls(workspace)
Parameter |
|
---|---|
workspace |
The workspace to sit in. Value must not be null. |
- Implements
- Blockly.IPositionable
Property
id
string
The unique id for this component that is used to register with the ComponentManager.
Methods
createDom
createDom() returns SVGElement
Create the zoom controls.
- Returns
-
non-null SVGElement
The zoom controls SVG group.
dispose
dispose()
Disposes 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
-
nullable Blockly.utils.Rect
The UI elements's bounding box. Null if bounding box should be ignored by other UI elements.
init
init()
Initializes the zoom 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