From d20be3112770c9fd252c91306675717dcb59e28f Mon Sep 17 00:00:00 2001 From: Nicholas Noll Date: Wed, 29 Sep 2021 10:54:50 -0700 Subject: chore(wm): add forgotten files --- sys/cmd/wm/util.c | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 sys/cmd/wm/util.c (limited to 'sys/cmd/wm/util.c') diff --git a/sys/cmd/wm/util.c b/sys/cmd/wm/util.c new file mode 100644 index 0000000..28b0e54 --- /dev/null +++ b/sys/cmd/wm/util.c @@ -0,0 +1,10 @@ +#include "wm.h" + +void +scale_box(struct wlr_box *box, float scale) +{ + box->width = ROUND((box->x + box->width) * scale) - ROUND(box->x * scale); + box->height = ROUND((box->y + box->height) * scale) - ROUND(box->y * scale); + box->x = ROUND(box->x * scale); + box->y = ROUND(box->y * scale); +} -- cgit v1.2.1