blockly > utils > Rect > createFromPoint

utils.Rect.createFromPoint() method

Creates a new Rect using a position and supplied dimensions.

Signature:

static createFromPoint(position: Coordinate, width: number, height: number): Rect;

Parameters

Parameter Type Description
position Coordinate The upper left coordinate of the new rectangle.
width number The width of the rectangle, in pixels.
height number The height of the rectangle, in pixels.

Returns:

Rect

A newly created Rect using the provided Coordinate and dimensions.