A class for representing two-dimensional rectangles whose properties are immutable.

Properties

T bottom
read-only, inherited
The y-coordinate of the bottom edge.
Point<T> bottomLeft
read-only, inherited
Point<T> bottomRight
read-only, inherited
int hashCode
read-only, inherited
T height
read-only
T left
read-only
read-only, inherited
The x-coordinate of the right edge.
T top
read-only
Point<T> topLeft
read-only, inherited
Point<T> topRight
read-only, inherited
T width
read-only

Constructors

Rectangle(T left, T top, T width, T height)
const
Create a rectangle spanned by (left, top) and (left+width, top+height).
Rectangle.fromPoints(Point<T> a, Point<T> b)
Create a rectangle spanned by the points a and b;

Operators

operator ==(other) → bool
inherited
The equality operator.

Methods

boundingBox(Rectangle<T> other) → Rectangle<T>
inherited
Returns a new rectangle which completely contains this and other.
containsPoint(Point<num> another) → bool
inherited
Tests whether another is inside or along the edges of this.
containsRectangle(Rectangle<num> another) → bool
inherited
Tests whether this entirely contains another.
intersection(Rectangle<T> other) → Rectangle<T>
inherited
Computes the intersection of this and other.
intersects(Rectangle<num> other) → bool
inherited
Returns true if this intersects other.
toString() → String
inherited
Returns a string representation of this object.