|
|
Hasty Badger
Small UI library (a branch of Turbo Badger)
|
Simple rectangle class. More...
#include <tb_geometry.h>
Public Member Functions | |
| TBRect (int x_, int y_, int w_, int h_) | |
| bool | IsEmpty () const |
| bool | IsInsideOut () const |
| bool | Equals (const TBRect &rect) const |
| bool | Intersects (const TBRect &rect) const |
| bool | Contains (const TBPoint &p) const |
| void | Reset () |
| void | Set (int x_, int y_, int w_, int h_) |
| TBRect | Shrink (int left, int top, int right, int bottom) const |
| TBRect | Expand (int left, int top, int right, int bottom) const |
| TBRect | Shrink (int tx, int ty) const |
| TBRect | Expand (int tx, int ty) const |
| TBRect | Offset (int dx, int dy) const |
| TBRect | MoveIn (const TBRect &bounding_rect) const |
| Return a rect moved inside bounding_rect. More... | |
| TBRect | CenterIn (const TBRect &bounding_rect) const |
| Return a rect centered in bounding_rect. More... | |
| TBRect | RightCenterIn (const TBRect &bounding_rect) const |
| Return a rect vertically centered on the right side in bounding_rect. More... | |
| TBRect | Union (const TBRect &rect) const |
| TBRect | Clip (const TBRect &clip_rect) const |
Public Attributes | |
| int | x |
| int | y |
| int | w |
| int | h |
Simple rectangle class.
Return a rect centered in bounding_rect.
Return a rect moved inside bounding_rect.
If the rect doesn't fit inside bounding_rect, it will be placed so the x and/or y matches bounding_rect.
Return a rect vertically centered on the right side in bounding_rect.