Skip to main content

blockly > MetricsManager > getViewMetrics

MetricsManager.getViewMetrics() method

Gets the metrics for the visible workspace in either pixel or workspace coordinates. The visible workspace does not include the toolbox or flyout.

Signature:

getViewMetrics(opt_getWorkspaceCoordinates?: boolean): ContainerRegion;

Parameters

Parameter

Type

Description

opt_getWorkspaceCoordinates

boolean

(Optional) True to get the view metrics in workspace coordinates, false to get them in pixel coordinates.

Returns:

ContainerRegion

The width, height, top and left of the viewport in either workspace coordinates or pixel coordinates.