From: Derek Foreman Date: Thu, 20 May 2010 23:41:16 +0000 (-0400) Subject: add a RECT_ADD macro X-Git-Tag: cgl~75 X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=cacfab6d733178b17afca7e83f90bda4db7f554d;p=dana%2Fopenbox.git add a RECT_ADD macro --- diff --git a/openbox/geom.h b/openbox/geom.h index 003b0081..4a36cfc0 100644 --- a/openbox/geom.h +++ b/openbox/geom.h @@ -93,6 +93,12 @@ typedef struct _Rect { ((o).x < (r).x + (r).width && (o).x + (o).width > (r).x && \ (o).y < (r).y + (r).height && (o).y + (o).height > (r).y) +#define RECT_ADD(o, a, b) \ + ((o).x = MIN((a).x, (b).x), \ + (o).y = MIN((a).y, (b).y), \ + (o).width = MAX((a).x + (a).width, (b).x + (b).width) - (o).x, \ + (o).height = MAX((a).y + (a).height, (b).y + (b).height) - (o).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), \