diff options
Diffstat (limited to 'src/helpers')
| -rw-r--r-- | src/helpers/MiscFunctions.cpp | 7 | ||||
| -rw-r--r-- | src/helpers/MiscFunctions.hpp | 3 | ||||
| -rw-r--r-- | src/helpers/Monitor.hpp | 1 |
3 files changed, 10 insertions, 1 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 diff --git a/src/helpers/MiscFunctions.hpp b/src/helpers/MiscFunctions.hpp index c71df0b1..c4192ff1 100644 --- a/src/helpers/MiscFunctions.hpp +++ b/src/helpers/MiscFunctions.hpp @@ -4,4 +4,5 @@ void addWLSignal(wl_signal*, wl_listener*, void* pOwner, std::string ownerString); void wlr_signal_emit_safe(struct wl_signal *signal, void *data); -std::string getFormat(const char *fmt, ...); // Basically Debug::log to a string
\ No newline at end of file +std::string getFormat(const char *fmt, ...); // Basically Debug::log to a string +void scaleBox(wlr_box*, float);
\ No newline at end of file diff --git a/src/helpers/Monitor.hpp b/src/helpers/Monitor.hpp index 3f88bed1..fb318c17 100644 --- a/src/helpers/Monitor.hpp +++ b/src/helpers/Monitor.hpp @@ -14,6 +14,7 @@ struct SMonitor { uint64_t ID = -1; int activeWorkspace = -1; + float scale = 1; std::string szName = ""; |
