From cfbe54e67a04094a3c42b6658d41c264dcb9e266 Mon Sep 17 00:00:00 2001 From: tokyo4j Date: Sat, 22 Feb 2025 15:20:53 +0900 Subject: [PATCH] box: add box_to_fbox() --- include/common/box.h | 2 ++ src/common/box.c | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/include/common/box.h b/include/common/box.h index 3d8e917f..6dc2fe3e 100644 --- a/include/common/box.h +++ b/include/common/box.h @@ -22,4 +22,6 @@ void box_union(struct wlr_box *box_dest, struct wlr_box *box_a, */ struct wlr_box box_fit_within(int width, int height, struct wlr_box *bounding_box); +struct wlr_fbox box_to_fbox(struct wlr_box *box); + #endif /* LABWC_BOX_H */ diff --git a/src/common/box.c b/src/common/box.c index 978108fd..a6316d16 100644 --- a/src/common/box.c +++ b/src/common/box.c @@ -73,3 +73,14 @@ box_fit_within(int width, int height, struct wlr_box *bound) return box; } + +struct wlr_fbox +box_to_fbox(struct wlr_box *box) +{ + return (struct wlr_fbox){ + .x = box->x, + .y = box->y, + .width = box->width, + .height = box->height, + }; +} -- 2.52.0