mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-03-12 05:34:35 -04:00
util/box: Add wlr_box_intersects
wlr_box_intersection generates a new box based on the intersection of two boxes. Often we simply want to know *if* two boxes intersected, which we can answer much cheaper. Add wlr_box_intersects, in similar vein as wlr_box_contains_box but returning true for any overlap.
This commit is contained in:
parent
285cee5f3a
commit
ff7d093800
2 changed files with 16 additions and 0 deletions
|
|
@ -107,6 +107,13 @@ void wlr_fbox_transform(struct wlr_fbox *dest, const struct wlr_fbox *box,
|
|||
|
||||
#ifdef WLR_USE_UNSTABLE
|
||||
|
||||
/**
|
||||
* Checks whether two boxes intersect.
|
||||
*
|
||||
* Returns false if either box is empty.
|
||||
*/
|
||||
bool wlr_box_intersects(const struct wlr_box *a, const struct wlr_box *b);
|
||||
|
||||
/**
|
||||
* Returns true if the two boxes are equal, false otherwise.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue