Public Member Functions | |
int | x () const |
int | y () const |
int | w () const |
int | h () const |
int | r () const |
int | b () const |
void | x (int v) |
void | y (int v) |
void | w (int v) |
void | h (int v) |
void | set_x (int v) |
void | set_y (int v) |
void | set_r (int v) |
void | set_b (int v) |
void | set (int x, int y, int w, int h) |
void | set (const Rectangle &r, int w, int h, int flags=0) |
void | move_x (int d) |
void | move_y (int d) |
void | move_r (int d) |
void | move_b (int d) |
void | inset (int d) |
void | move (int dx, int dy) |
bool | empty () const |
bool | not_empty () const |
int | center_x () const |
int | center_y () const |
int | baseline_y () const |
Rectangle (int x, int y, int w, int h) | |
Rectangle (int w, int h) | |
Rectangle (const Rectangle &r) | |
Rectangle (const Rectangle &r, int w, int h, int flags=0) | |
bool | contains (int x, int y) const |
void | merge (const Rectangle &r) |
|
|
Constructor that sets x() and y() to zero, and sets w() and h(). |
|
Copy constructor. |
|
Constructor that calls set(). |
|
Return y()+h(), the bottom edge of the rectangle. |
|
Where to put baseline to center current font nicely |
|
Integer center position. Rounded to the left if w() is odd. |
|
Integer center position. Rounded to lower y if h() is odd. |
|
True if rectangle contains the pixel who's upper-left corner is at x,y |
|
|
|
Distance between top and bottom edges |
|
Move all edges in by d. See also Symbol::inset() |
|
calculate bounding box of this union r |
|
Move entire rectangle by given distance in x and y. |
|
|
|
|
|
Same as !empty(), true if w() and h() are both greater than zero. |
|
Return x()+w(), the right edge of the rectangle. |
|
Sets x, y, w, h so that's it's centered or aligned (if flags!=0) inside the source r |
|
|
|
|
|
|
|
Distance between left and right edges |
|
Move the rectangle so the left edge is at v. |
|
Left edge |
|
Move the rectangle so the top edge is at v. |
|
Top edge |