blockly > WorkspaceSvg > setScale
WorkspaceSvg.setScale() method
Set the workspace's zoom factor.
Signature:
setScale(newScale: number): void;
Parameters
Parameter |
Type |
Description |
newScale |
number |
Zoom factor. Units: (pixels / workspaceUnit). |
Returns:
void
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[null,null,["Last updated 2024-09-18 UTC."],[[["Sets the zoom level of the workspace, controlling how large or small blocks and other elements appear."],["Takes a single argument, `newScale`, which represents the zoom factor as a ratio of pixels to workspace units."],["Modifies the workspace's zoom directly and doesn't return any value."],["`setScale` method belongs to the `WorkspaceSvg` class within the Blockly library and is used to dynamically adjust the visual scale of the workspace."]]],[]]