aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/wlr/util/box.h9
-rw-r--r--util/box.c9
2 files changed, 18 insertions, 0 deletions
diff --git a/include/wlr/util/box.h b/include/wlr/util/box.h
index 8516688d..e01b351e 100644
--- a/include/wlr/util/box.h
+++ b/include/wlr/util/box.h
@@ -92,4 +92,13 @@ bool wlr_fbox_empty(const struct wlr_fbox *box);
void wlr_fbox_transform(struct wlr_fbox *dest, const struct wlr_fbox *box,
enum wl_output_transform transform, double width, double height);
+#ifdef WLR_USE_UNSTABLE
+
+/**
+ * Returns true if the two boxes are equal, false otherwise.
+ */
+bool wlr_box_equal(const struct wlr_box *a, const struct wlr_box *b);
+
+#endif
+
#endif
diff --git a/util/box.c b/util/box.c
index a9edc144..cddff76e 100644
--- a/util/box.c
+++ b/util/box.c
@@ -171,3 +171,12 @@ void wlr_fbox_transform(struct wlr_fbox *dest, const struct wlr_fbox *box,
break;
}
}
+
+#ifdef WLR_USE_UNSTABLE
+
+bool wlr_box_equal(const struct wlr_box *a, const struct wlr_box *b) {
+ return a->x == b->x && a->y == b->y &&
+ a->width == b->width && a->height == b->height;
+}
+
+#endif