summaryrefslogtreecommitdiffstats
path: root/common/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/common.c')
-rw-r--r--common/common.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/common/common.c b/common/common.c
index a07af8c461..9ed63e1783 100644
--- a/common/common.c
+++ b/common/common.c
@@ -115,6 +115,12 @@ bool mp_rect_intersection(struct mp_rect *rc, const struct mp_rect *rc2)
return rc->x1 > rc->x0 && rc->y1 > rc->y0;
}
+bool mp_rect_equals(struct mp_rect *rc1, struct mp_rect *rc2)
+{
+ return rc1->x0 == rc2->x0 && rc1->y0 == rc2->y0 &&
+ rc1->x1 == rc2->x1 && rc1->y1 == rc2->y1;
+}
+
// This works like snprintf(), except that it starts writing the first output
// character to str[strlen(str)]. This returns the number of characters the
// string would have *appended* assuming a large enough buffer, will make sure