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:

Math (Core)

#include <ClanLib/core.h>

Class Members:

Construction:

CL_Rect

Constructs an rectangle.

operator==

Rect == Rect operator.

operator!=

Rect != Rect operator.


Attributes:

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.

get_center

Returns the center point of the rectangle.

left

X1-coordinate.

top

Y1-coordinate.

right

X2-coordinate.

bottom

Y2-coordinate.


Operations:

shrink

Shrink the rectangle.

expand

Expand the rectangle.

translate

Translate the rect.

set_size

Sets the size of the rectangle, maintaining top/left position.

calc_overlap

Calculates and returns the union of two rectangles.

calc_bounding_rect

Calculates and returns the bounding rectangle of the 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.

clip

Clip according to the specified clip rectangle.