summaryrefslogtreecommitdiff
path: root/src/helpers
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
parent748a787ba2935f62b1a6f986a3fd6c758a8ba626 (diff)
store scale and scale windows with monitor
Diffstat (limited to 'src/helpers')
-rw-r--r--src/helpers/MiscFunctions.cpp7
-rw-r--r--src/helpers/MiscFunctions.hpp3
-rw-r--r--src/helpers/Monitor.hpp1
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 = "";