class SmallRect

Describes a rectangular area in zero-based character coordinates and sizes.

Global Functions

int Compare (const var, const var)Compares two rectangles.

Constructors

SmallRect ()Constructs a new zero rectangle.
SmallRect (const Location, const SmallSize)Constructs a rectangle from a location and a size.
SmallRect (const int, const int, const int, const int)Constructs a rectangle from x, y coordinates and width, height.
SmallRect (const SmallRect)Copy-constructs a rectangle.

Methods

int Contains (const Location)Returns true if the rectangle contains the specified location.
int Contains (const SmallRect)Returns true if the rectangle entirely contains the specified rectangle.
Inflate (const int, const int)Symmetrically increases / decreases the size of the rectangle by the specified offsets.
Offset (const int, const int)Moves the rectangle by the specified x and y offsets.
int Overlaps (const SmallRect)Returns true if the rectangle overlaps with the specified rectangle.

Properties

int Bottom ()Returns the bottom coordinate of the rectangle.
Bottom (const int)Sets the bottom coordinate of the rectangle.
int Height ()Returns the height of the rectangle.
Height (const int)Sets the height of the rectangle.
int Left ()Returns the left coordinate of the rectangle.
Left (const int)Sets the left coordinate of the rectangle.
Location Location ()Returns the location of the upper-left corner of this rectangle.
Location (const Location)Sets (moves) the rectangle to a new location.
int Right ()Returns the right coordinate of the rectangle.
Right (const int)Sets the right coordinate of the rectangle.
SmallSize Size ()Returns the size of the rectangle.
Size (const SmallSize)Sets the rectangle to a new size.
int Top ()Returns the top coordinate of the rectangle.
Top (const int)Sets the top coordinate of the rectangle.
int Width ()Returns the width of the rectangle.
Width (const int)Sets the width of the rectangle.

Reference

function int Compare (const var v1, const var v2)

Compares two rectangles.

This can be used as a comparator delegate for the array::sort() and list::sort() functions.


method SmallRect ()

Constructs a new zero rectangle.


method SmallRect (const Location c, const SmallSize s)

Constructs a rectangle from a location and a size.


method SmallRect (const int x, const int y, const int w, const int h)

Constructs a rectangle from x, y coordinates and width, height.


method SmallRect (const SmallRect src)

Copy-constructs a rectangle.


method int Contains (const Location c)

Returns true if the rectangle contains the specified location.


method int Contains (const SmallRect r)

Returns true if the rectangle entirely contains the specified rectangle.


method Inflate (const int dx, const int dy)

Symmetrically increases / decreases the size of the rectangle by the specified offsets.


method Offset (const int x, const int y)

Moves the rectangle by the specified x and y offsets.


method int Overlaps (const SmallRect r)

Returns true if the rectangle overlaps with the specified rectangle.


accessor int Bottom ()

Returns the bottom coordinate of the rectangle.


accessor Bottom (const int)

Sets the bottom coordinate of the rectangle.


accessor int Height ()

Returns the height of the rectangle.


accessor Height (const int)

Sets the height of the rectangle.


accessor int Left ()

Returns the left coordinate of the rectangle.


accessor Left (const int)

Sets the left coordinate of the rectangle.


accessor Location Location ()

Returns the location of the upper-left corner of this rectangle.


accessor Location (const Location c)

Sets (moves) the rectangle to a new location.


accessor int Right ()

Returns the right coordinate of the rectangle.


accessor Right (const int)

Sets the right coordinate of the rectangle.


accessor SmallSize Size ()

Returns the size of the rectangle.


accessor Size (const SmallSize s)

Sets the rectangle to a new size.


accessor int Top ()

Returns the top coordinate of the rectangle.


accessor Top (const int)

Sets the top coordinate of the rectangle.


accessor int Width ()

Returns the width of the rectangle.


accessor Width (const int)

Sets the width of the rectangle.