mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-02-05 04:06:11 -05:00
util/box: Introduce wlr_box_contains_box
This commit is contained in:
parent
8730ca9661
commit
4b4ca11f6f
2 changed files with 19 additions and 0 deletions
11
util/box.c
11
util/box.c
|
|
@ -79,6 +79,17 @@ bool wlr_box_contains_point(const struct wlr_box *box, double x, double y) {
|
|||
}
|
||||
}
|
||||
|
||||
bool wlr_box_contains_box(const struct wlr_box *bigger, const struct wlr_box *smaller) {
|
||||
if (wlr_box_empty(bigger) || wlr_box_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;
|
||||
}
|
||||
|
||||
void wlr_box_transform(struct wlr_box *dest, const struct wlr_box *box,
|
||||
enum wl_output_transform transform, int width, int height) {
|
||||
struct wlr_box src = {0};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue