commit a22ca29561af5b1c9f6da39f2646d47727fb0757 parent 6d446a98a2f7476e179aef4504fb64a15fd80f2c Author: deurzen <max@deurzen.net> Date: Wed, 1 Jun 2022 05:49:23 +0200 adds wlr_box->Region conversion Diffstat:
M | include/kranewl/geometry.hh | | | 15 | +++++++++++++++ |
1 file changed, 15 insertions(+), 0 deletions(-)
diff --git a/include/kranewl/geometry.hh b/include/kranewl/geometry.hh @@ -181,6 +181,21 @@ struct Region final { Pos pos; Dim dim; + static inline Region + from_box(struct wlr_box box) + { + return Region{ + .pos = { + .x = box.x, + .y = box.y + }, + .dim = { + .w = box.width, + .h = box.height + } + }; + } + operator struct wlr_box() const { struct wlr_box box;