summaryrefslogtreecommitdiff
path: root/src/helpers/MiscFunctions.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-04-17 18:47:10 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-04-17 18:47:10 +0200
commitb0f5e4ab5656fb3b72efa7ce646d4b47ae82b814 (patch)
tree0eef3cf73193a8e64e9d2f547f03066939a38377 /src/helpers/MiscFunctions.cpp
parent748a787ba2935f62b1a6f986a3fd6c758a8ba626 (diff)
store scale and scale windows with monitor
Diffstat (limited to 'src/helpers/MiscFunctions.cpp')
-rw-r--r--src/helpers/MiscFunctions.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/helpers/MiscFunctions.cpp b/src/helpers/MiscFunctions.cpp
index ceb457c4..a3aa7871 100644
--- a/src/helpers/MiscFunctions.cpp
+++ b/src/helpers/MiscFunctions.cpp
@@ -54,4 +54,11 @@ std::string getFormat(const char *fmt, ...) {
va_end(args);
return std::string(buf);
+}
+
+void scaleBox(wlr_box* box, float scale) {
+ box->width = std::round((box->x + box->width) * scale) - std::round(box->x * scale);
+ box->height = std::round((box->y + box->height) * scale) - std::round(box->y * scale);
+ box->x = std::round(box->x * scale);
+ box->y = std::round(box->y * scale);
} \ No newline at end of file