Skip to main content

Home > blockly > utils > Rect > from

utils.Rect.from() method

Converts a DOM or SVG Rect to a Blockly Rect.

Signature:

static from(rect: DOMRect | SVGRect): Rect;

Parameters

ParameterTypeDescription
rectDOMRect | SVGRectThe rectangle to convert.

Returns:

Rect

A representation of the same rectangle as a Blockly Rect.