util/box: introduce wlr_fbox_intersection

Signed-off-by: Loukas Agorgianitis <loukas@agorgianitis.com>
This commit is contained in:
Loukas Agorgianitis 2025-04-14 11:38:47 +02:00
parent 62234c5133
commit 72c31255c3
No known key found for this signature in database
GPG key ID: DDC6FA7D5BB332E6
2 changed files with 36 additions and 0 deletions

View file

@ -61,6 +61,14 @@ void wlr_box_closest_point(const struct wlr_box *box, double x, double y,
bool wlr_box_intersection(struct wlr_box *dest, const struct wlr_box *box_a,
const struct wlr_box *box_b);
/**
* Gives the intersecting box between two struct wlr_fbox.
*
* Returns an empty box if the provided boxes don't intersect.
*/
bool wlr_fbox_intersection(struct wlr_fbox *dest, const struct wlr_fbox *box_a,
const struct wlr_fbox *box_b);
/**
* Verifies if a point is contained within the bounds of a given struct wlr_box.
*