Stay organized with collections
Save and categorize content based on your preferences.
blockly > WorkspaceSvg > getScale
WorkspaceSvg.getScale() method
Get the workspace's zoom factor.
Signature:
getScale(): number;
Returns:
number
The workspace zoom factor. Units: (pixels / workspaceUnit).
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 2025-05-16 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-05-16 UTC."],[[["\u003cp\u003e\u003ccode\u003eWorkspaceSvg.getScale()\u003c/code\u003e returns the zoom factor of the workspace, indicating the ratio of pixels to workspace units.\u003c/p\u003e\n"],["\u003cp\u003eIf the workspace is nested within a parent workspace, the zoom factor is retrieved from the parent workspace.\u003c/p\u003e\n"],["\u003cp\u003eThe returned value represents the scale of the workspace, with higher values indicating a greater zoom level.\u003c/p\u003e\n"]]],[],null,["[blockly](./blockly.md) \\\u003e [WorkspaceSvg](./blockly.workspacesvg_class.md) \\\u003e [getScale](./blockly.workspacesvg_class.getscale_1_method.md)\n\nWorkspaceSvg.getScale() method\n------------------------------\n\nGet the workspace's zoom factor.\n\n**Signature:** \n\n getScale(): number;\n\n**Returns:**\n\nnumber\n\nThe workspace zoom factor. Units: (pixels / workspaceUnit)."]]