From b0f5e4ab5656fb3b72efa7ce646d4b47ae82b814 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Sun, 17 Apr 2022 18:47:10 +0200 Subject: store scale and scale windows with monitor --- src/helpers/MiscFunctions.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/helpers/MiscFunctions.cpp') 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 -- cgit v1.2.3