util/box: Introduce wlr_box_equal

This commit is contained in:
Alexander Orzechowski 2022-08-15 06:14:28 -04:00
parent 59675347e6
commit 9f3bd64a33
2 changed files with 18 additions and 0 deletions

View File

@ -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, void wlr_fbox_transform(struct wlr_fbox *dest, const struct wlr_fbox *box,
enum wl_output_transform transform, double width, double height); 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 #endif

View File

@ -171,3 +171,12 @@ void wlr_fbox_transform(struct wlr_fbox *dest, const struct wlr_fbox *box,
break; 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