diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-04-17 18:47:10 +0200 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-04-17 18:47:10 +0200 |
| commit | b0f5e4ab5656fb3b72efa7ce646d4b47ae82b814 (patch) | |
| tree | 0eef3cf73193a8e64e9d2f547f03066939a38377 /src/helpers/MiscFunctions.cpp | |
| parent | 748a787ba2935f62b1a6f986a3fd6c758a8ba626 (diff) | |
store scale and scale windows with monitor
Diffstat (limited to 'src/helpers/MiscFunctions.cpp')
| -rw-r--r-- | src/helpers/MiscFunctions.cpp | 7 |
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 |
