diff options
| author | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2023-11-11 14:37:17 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-11 14:37:17 +0000 |
| commit | 9be6fbf5eae8c4b902b818881a4dc34f87bb630d (patch) | |
| tree | a5d440cd8f5d57a659df670548263eba1cd93a0a /src/helpers/Region.cpp | |
| parent | 7345b1a1ea2671953df48c8a18524a7e556d383c (diff) | |
decorations: Decoration Positioner (#3800)
Diffstat (limited to 'src/helpers/Region.cpp')
| -rw-r--r-- | src/helpers/Region.cpp | 9 |
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; |
