1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
typedef struct { int v; int h; } Point; typedef struct { int top, left, bottom, right; } Rect; int x_PtInRect (Point pt, Rect *r) { return pt.v >= r->top && pt.v < r->bottom && pt.h >= r->left && pt.h < r->right; }