diff --git a/include/hyprutils/math/Region.hpp b/include/hyprutils/math/Region.hpp index f7589f2..776a668 100644 --- a/include/hyprutils/math/Region.hpp +++ b/include/hyprutils/math/Region.hpp @@ -58,6 +58,14 @@ namespace Hyprutils { CRegion copy() const; std::vector getRects() const; + template + void forEachRect(T&& cb) const { + int rectsNum = 0; + const auto* rects = pixman_region32_rectangles(&m_rRegion, &rectsNum); + for (int i = 0; i < rectsNum; ++i) { + std::forward(cb)(rects[i]); + } + } // pixman_region32_t* pixman() {