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

Parameter Type Description
rect DOMRect | SVGRect The rectangle to convert.

Returns:

Rect

A representation of the same rectangle as a Blockly Rect.