Stay organized with collections
Save and categorize content based on your preferences.
blockly > Options > setMetrics
Options.setMetrics property
If set, sets the translation of the workspace to match the scrollbars. A function that sets the translation of the workspace to match the scrollbars. The argument Contains an x and/or y property which is a float between 0 and 1 specifying the degree of scrolling.
Signature:
setMetrics?: (p1: {
x?: number;
y?: number;
}) => 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.
[[["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 2024-09-18 UTC."],[[["The `setMetrics` property is a function within Blockly's Options class that manages workspace translation to align with scrollbars."],["It optionally accepts an argument containing `x` and/or `y` properties (floats between 0 and 1) representing the horizontal and vertical scroll positions, respectively."],["When called, `setMetrics` adjusts the workspace's position based on these provided scroll values, ensuring visual synchronization with the scrollbars."]]],[]]