add RECT_CONTAINS
This commit is contained in:
parent
45f6d52712
commit
bf707e7240
1 changed files with 9 additions and 6 deletions
|
@ -32,6 +32,9 @@ typedef struct Rect {
|
|||
#define RECT_EQUAL(r1, r2) (r1.x == r2.x && r1.y == r2.y && \
|
||||
r1.width == r2.width && r1.height == r2.height)
|
||||
|
||||
#define RECT_CONTAINS(r, x, y) \
|
||||
(x >= r.x && x < r.x + r.width && y >= r.y && y < r.y + r.height)
|
||||
|
||||
typedef struct Strut {
|
||||
int left;
|
||||
int top;
|
||||
|
|
Loading…
Reference in a new issue