class
Rectangle<T extends num>

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

Implemented by

Properties

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

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

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