aboutsummaryrefslogtreecommitdiff
path: root/util/box.c
diff options
context:
space:
mode:
authorAlexander Orzechowski <alex@ozal.ski>2023-05-20 19:57:51 -0400
committerKirill Primak <vyivel@eclair.cafe>2023-05-23 17:57:16 +0000
commitd495fb8c046751cfeb06af2227d413dc3dbc9bf0 (patch)
treef4409a388a1eb3286a2026ec5c7d08e52fd9a3b5 /util/box.c
parentacaf57dcca9a10e469f92620a145c040224b2384 (diff)
wlr_{box, fbox}_equal: Consider empty boxes NULL
Diffstat (limited to 'util/box.c')
-rw-r--r--util/box.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/util/box.c b/util/box.c
index 48bfbfdd..2ff22686 100644
--- a/util/box.c
+++ b/util/box.c
@@ -175,6 +175,13 @@ void wlr_fbox_transform(struct wlr_fbox *dest, const struct wlr_fbox *box,
#ifdef WLR_USE_UNSTABLE
bool wlr_box_equal(const struct wlr_box *a, const struct wlr_box *b) {
+ if (wlr_box_empty(a)) {
+ a = NULL;
+ }
+ if (wlr_box_empty(b)) {
+ b = NULL;
+ }
+
if (a == NULL || b == NULL) {
return a == b;
}
@@ -184,6 +191,13 @@ bool wlr_box_equal(const struct wlr_box *a, const struct wlr_box *b) {
}
bool wlr_fbox_equal(const struct wlr_fbox *a, const struct wlr_fbox *b) {
+ if (wlr_fbox_empty(a)) {
+ a = NULL;
+ }
+ if (wlr_fbox_empty(b)) {
+ b = NULL;
+ }
+
if (a == NULL || b == NULL) {
return a == b;
}