Skip to main content

Home > 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

ParameterTypeDescription
positionCoordinateThe upper left coordinate of the new rectangle.
widthnumberThe width of the rectangle, in pixels.
heightnumberThe height of the rectangle, in pixels.

Returns:

Rect

A newly created Rect using the provided Coordinate and dimensions.