blockly > utils > Rect

utils.Rect class

Class for representing rectangular regions.

Signature:

export declare class Rect 

Constructors

Constructor Modifiers Description
(constructor)(top, bottom, left, right) Constructs a new instance of the Rect class

Properties

Property Modifiers Type Description
bottom number
left number
right number
top number

Methods

Method Modifiers Description
clone() Creates a new copy of this rectangle.
contains(x, y) Tests whether this rectangle contains a x/y coordinate.
createFromPoint(position, width, height) static Creates a new Rect using a position and supplied dimensions.
equals(a, b) static Compares bounding rectangles for equality.
getHeight() Returns the height of this rectangle.
getWidth() Returns the width of this rectangle.
intersects(other) Tests whether this rectangle intersects the provided rectangle. Assumes that the coordinate system increases going down and left.