static bool rectContains(int x1, int y1, int w, int h, Pt p) { ret p.x >= x1 && p.y >= y1 && p.x < x1+w && p.y < y1+h; } static bool rectContains(Rect a, Rect b) { ret b.x >= a.x && b.y >= a.y && b.x2() <= a.x2() && b.y2() <= a.y2(); }