mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-04-13 08:22:16 -04:00
util/box: introduce wlr_fbox_contains_box
Signed-off-by: Loukas Agorgianitis <loukas@agorgianitis.com>
This commit is contained in:
parent
d26884920e
commit
c7d6629d16
2 changed files with 19 additions and 0 deletions
11
util/box.c
11
util/box.c
|
|
@ -130,6 +130,17 @@ bool wlr_box_contains_box(const struct wlr_box *bigger, const struct wlr_box *sm
|
|||
smaller->y + smaller->height <= bigger->y + bigger->height;
|
||||
}
|
||||
|
||||
bool wlr_fbox_contains_box(const struct wlr_fbox *bigger, const struct wlr_fbox *smaller) {
|
||||
if (wlr_fbox_empty(bigger) || wlr_fbox_empty(smaller)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return smaller->x >= bigger->x &&
|
||||
smaller->x + smaller->width <= bigger->x + bigger->width &&
|
||||
smaller->y >= bigger->y &&
|
||||
smaller->y + smaller->height <= bigger->y + bigger->height;
|
||||
}
|
||||
|
||||
bool wlr_box_intersects(const struct wlr_box *a, const struct wlr_box *b) {
|
||||
if (wlr_box_empty(a) || wlr_box_empty(b)) {
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue