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.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/helpers/Region.cpp b/src/helpers/Region.cpp
index fdf8a242..06b8536c 100644
--- a/src/helpers/Region.cpp
+++ b/src/helpers/Region.cpp
@@ -21,8 +21,8 @@ CRegion::CRegion(wlr_box* box) {
pixman_region32_init_rect(&m_rRegion, box->x, box->y, box->width, box->height);
}
-CRegion::CRegion(CBox* box) {
- pixman_region32_init_rect(&m_rRegion, box->x, box->y, box->w, box->h);
+CRegion::CRegion(const CBox& box) {
+ pixman_region32_init_rect(&m_rRegion, box.x, box.y, box.w, box.h);
}
CRegion::CRegion(pixman_box32_t* box) {
@@ -63,6 +63,11 @@ CRegion& CRegion::add(double x, double y, double w, double h) {
return *this;
}
+CRegion& CRegion::add(const CBox& other) {
+ pixman_region32_union_rect(&m_rRegion, &m_rRegion, other.x, other.y, other.w, other.h);
+ return *this;
+}
+
CRegion& CRegion::subtract(const CRegion& other) {
pixman_region32_subtract(&m_rRegion, &m_rRegion, const_cast<CRegion*>(&other)->pixman());
return *this;