From 9be6fbf5eae8c4b902b818881a4dc34f87bb630d Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Sat, 11 Nov 2023 14:37:17 +0000 Subject: decorations: Decoration Positioner (#3800) --- src/helpers/Region.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/helpers/Region.cpp') 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(&other)->pixman()); return *this; -- cgit v1.2.3