From 9cc9d19eee1ceddf189bf21e1b69ea12f95395ec Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 7 Mar 2014 12:46:22 +0100 Subject: common: add some helper macros --- common/common.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/common.h b/common/common.h index afb0f6ceda..aad1460aa2 100644 --- a/common/common.h +++ b/common/common.h @@ -70,6 +70,9 @@ struct mp_rect { int x1, y1; }; +#define mp_rect_w(r) ((r).x1 - (r).x0) +#define mp_rect_h(r) ((r).y1 - (r).y0) + void mp_rect_union(struct mp_rect *rc, const struct mp_rect *src); bool mp_rect_intersection(struct mp_rect *rc, const struct mp_rect *rc2); -- cgit v1.2.3