+#define RECT_SET_INTERSECTION(r, a, b) \
+ ((r).x = MAX((a).x, (b).x), \
+ (r).y = MAX((a).y, (b).y), \
+ (r).width = MIN((a).x + (a).width - 1, \
+ (b).x + (b).width - 1) - (r).x + 1, \
+ (r).height = MIN((a).y + (a).height - 1, \
+ (b).y + (b).height - 1) - (r).y + 1)
+