box: add box_to_fbox()

This commit is contained in:
tokyo4j 2025-02-22 15:20:53 +09:00
parent c1a27b139c
commit cfbe54e67a
2 changed files with 13 additions and 0 deletions

View 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 */

View 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,
};
}