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.