37 #include "../api_core.h"
49 template<
typename Type>
58 CL_Rectx() { left = right = top = bottom = 0; }
71 CL_Rectx(Type new_left, Type new_top, Type new_right, Type new_bottom)
72 { left = new_left; top = new_top; right = new_right; bottom = new_bottom; }
79 { left = p.
x; top = p.
y; right = left + size.
width; bottom = top + size.
height; }
87 { left = new_left; top = new_top; right = left + size.
width; bottom = top + size.
height; }
106 {
return (left == r.
left && top == r.
top && right == r.
right && bottom == r.
bottom); }
110 {
return (left != r.
left || top != r.
top || right != r.
right || bottom != r.
bottom); }
140 return ((p.
x >= left && p.
x <= right) || (p.
x <= left && p.
x >= right))
141 && ((p.
y >= top && p.
y <= bottom) || (p.
y <= top && p.
y >= bottom));
177 return ((left <= r.
left)
179 && (right >= r.
right)
252 right = left + width;
261 bottom = top + height;
270 this->left += left; this->top += top; this->right -= right; this->bottom -= bottom;
279 this->left += left_right; this->top += top_bottom; this->right -= left_right; this->bottom -= top_bottom;
288 this->left += shrink; this->top += shrink; this->right -= shrink; this->bottom -= shrink;
297 this->left -= left; this->top -= top; this->right += right; this->bottom += bottom;
306 this->left -= left_and_right;
307 this->right += left_and_right;
308 this->top -= top_and_bottom;
309 this->bottom += top_and_bottom;
318 this->left -= expand;
319 this->right += expand;
321 this->bottom += expand;
330 left += p.
x; top += p.
y; right += p.
x; bottom += p.
y;
348 left += x; top += y; right += x; bottom += y;
357 right = left + size.
width;
358 bottom = top + size.
height;
443 top =
cl_min(top, bottom);
444 left =
cl_min(left, right);
458 template<
typename Type>
460 { left = (Type) rect.
left; top = (Type) rect.
top; right = (Type) rect.
right; bottom = (Type) rect.
bottom; }
462 template<
typename Type>
464 { left = (Type) rect.
left; top = (Type) rect.
top; right = (Type) rect.
right; bottom = (Type) rect.
bottom; }
466 template<
typename Type>
468 { left = (Type) rect.
left; top = (Type) rect.
top; right = (Type) rect.
right; bottom = (Type) rect.
bottom; }
478 CL_Rect(
int new_left,
int new_top,
int new_right,
int new_bottom) :
CL_Rectx<int>(new_left, new_top, new_right, new_bottom) {}
495 CL_Rectf(
float new_left,
float new_top,
float new_right,
float new_bottom) :
CL_Rectx<float>(new_left, new_top, new_right, new_bottom) {}
513 CL_Rectd(
double new_left,
double new_top,
double new_right,
double new_bottom) :
CL_Rectx<double>(new_left, new_top, new_right, new_bottom) {}
523 return CL_Rect(x, y, x+width, y+height);
528 return CL_Rectf(x, y, x+width, y+height);
533 return CL_Rectd(x, y, x+width, y+height);