X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fgeom.h;h=d55bc0817bb54768509eacfe3e81f6219334ca0a;hb=943dd68152d052188d7a5a0d33c8238f474eb462;hp=91dd48eb2301de62f5f1e8ac625ae669279cc042;hpb=05863a61b89c41f2633651a156c5e918207e29b3;p=chaz%2Fopenbox diff --git a/openbox/geom.h b/openbox/geom.h index 91dd48eb..d55bc081 100644 --- a/openbox/geom.h +++ b/openbox/geom.h @@ -62,10 +62,13 @@ typedef struct _Rect { #define RECT_CONTAINS_RECT(r, o) \ ((o).x >= (r).x && (o).x + (o).width <= (r).x + (r).width && \ (o).y >= (r).y && (o).y + (o).height <= (r).y + (r).height) + +/* Returns true if Rect r and o intersect */ #define RECT_INTERSECTS_RECT(r, o) \ ((o).x < (r).x + (r).width && (o).x + (o).width > (r).x && \ (o).y < (r).y + (r).height && (o).y + (o).height > (r).y) +/* Sets Rect r to be the intersection of Rect a and b. */ #define RECT_SET_INTERSECTION(r, a, b) \ ((r).x = MAX((a).x, (b).x), \ (r).y = MAX((a).y, (b).y), \