]> git.mdlowis.com Git - proto/labwc.git/commitdiff
box: add box_to_fbox()
authortokyo4j <hrak1529@gmail.com>
Sat, 22 Feb 2025 06:20:53 +0000 (15:20 +0900)
committertokyo4j <hrak1529@gmail.com>
Sat, 22 Feb 2025 11:38:03 +0000 (20:38 +0900)
include/common/box.h
src/common/box.c

index 3d8e917f547714127cf0e673e83eb0b39f52fe2b..6dc2fe3e973e08b456709c680c484cefc1cd3830 100644 (file)
@@ -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 */
index 978108fdef82cb270fe16d0711c0faa4e04e343c..a6316d16ca59fa6677a6c8fc8948ed8b3b46123d 100644 (file)
@@ -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,
+       };
+}