aboutsummaryrefslogtreecommitdiff
path: root/sys/cmd/wm/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/cmd/wm/util.c')
-rw-r--r--sys/cmd/wm/util.c10
1 files changed, 10 insertions, 0 deletions
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);
+}