Home | All Classes | Grouped Classes | Index | Search

# Class CL_Rect

2D (left,top,right,bottom) rectangle structure. More...

Derived from: none
Derived by: none
Group: Core (Math)

#include <ClanLib/core.h>

Construction:

CL_Rect | Constructs an rectangle.
operator += | Rect += Rect operator.
operator -= | Rect -= Rect operator.
operator + | Rect + Rect operator.
operator - | Rect - Rect operator.
operator == | Rect == Rect operator.
operator != | Rect != Rect operator.

Attributes:

left | X1-coordinate.
top | Y1-coordinate.
right | X2-coordinate.
bottom | Y2-coordinate.
get_width | Returns the width of the rectangle.
get_height | Returns the height of the rectangle.
get_size | Returns the size of the rectangle.
is_inside | Returns true if point is inside the rectangle.
is_overlapped | Returns true if rectangle passed is overlapping or inside this rectangle.
get_rot_bounds | Returns another CL_Rect containing a rotated version of this one.

Operations:

set_size | Sets the size of the rectangle, maintaining top/left position.
calc_union | Calculates and returns the union of two rectangles.
normalize | Normalize rectangle. Ensures that left is less than right and top is less than bottom.
apply_alignment | Applies an origin and offset pair to this rectangle

Detailed description:

!group=Core/Math! !header=core.h!
Questions or comments, write to the ClanLib mailing list.