summaryrefslogtreecommitdiff
path: root/src/helpers/Region.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/helpers/Region.cpp')
-rw-r--r--src/helpers/Region.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/helpers/Region.cpp b/src/helpers/Region.cpp
index 20eaf452..9e572b34 100644
--- a/src/helpers/Region.cpp
+++ b/src/helpers/Region.cpp
@@ -4,6 +4,8 @@ extern "C" {
#include <wlr/util/region.h>
}
+constexpr const int64_t MAX_REGION_SIDE = 10000000;
+
CRegion::CRegion() {
pixman_region32_init(&m_rRegion);
}
@@ -103,6 +105,11 @@ CRegion& CRegion::transform(const wl_output_transform t, double w, double h) {
return *this;
}
+CRegion& CRegion::rationalize() {
+ intersect(CBox{-MAX_REGION_SIDE, -MAX_REGION_SIDE, MAX_REGION_SIDE * 2, MAX_REGION_SIDE * 2});
+ return *this;
+}
+
CRegion CRegion::copy() const {
return CRegion(*this);
}