summaryrefslogtreecommitdiff
path: root/openbox/geom.h
diff options
context:
space:
mode:
Diffstat (limited to 'openbox/geom.h')
-rw-r--r--openbox/geom.h3
1 files changed, 3 insertions, 0 deletions
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), \