blockly > MetricsManager > getDimensionsPx_
MetricsManager.getDimensionsPx_() method
Gets the dimensions of the given workspace component, in pixel coordinates.
Signature:
protected getDimensionsPx_(elem: IToolbox | null | IFlyout): Size;
Parameters
Parameter |
Type |
Description |
elem |
IToolbox | null | IFlyout |
The element to get the dimensions of, or null. It should be a toolbox or flyout, and should implement getWidth() and getHeight(). |
Returns:
Size
An object containing width and height attributes, which will both be zero if elem did not exist.
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."],[[["The `MetricsManager.getDimensionsPx_()` method retrieves the pixel dimensions (width and height) of a specified workspace component, such as a toolbox or flyout."],["It accepts an `IToolbox`, `IFlyout`, or `null` as input, representing the target element for measurement."],["The method returns a `Size` object containing the width and height of the element; if the element is null, both dimensions will be zero."]]],[]]