From: tokyo4j Date: Sat, 22 Feb 2025 06:20:53 +0000 (+0900) Subject: box: add box_to_fbox() X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=cfbe54e67a04094a3c42b6658d41c264dcb9e266;p=proto%2Flabwc.git box: add box_to_fbox() --- 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, + }; +}