diff options
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 |
