renderer/pass: fix surface opaque region bounds used in occluding (#13124)

This commit is contained in:
jmanc3 2026-01-31 07:39:22 -06:00 committed by GitHub
parent cbeb6984e7
commit db6114c6c5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -55,7 +55,16 @@ void CRenderPass::simplify() {
auto opaque = el->element->opaqueRegion();
if (!opaque.empty()) {
opaque.scale(g_pHyprOpenGL->m_renderData.pMonitor->m_scale);
// scale and rounding is very particular so we have to use CBoxes scale and round functions
if (opaque.getRects().size() == 1)
opaque = opaque.getExtents().scale(g_pHyprOpenGL->m_renderData.pMonitor->m_scale).round();
else {
CRegion scaledRegion;
opaque.forEachRect([&scaledRegion](const auto& RECT) {
scaledRegion.add(CBox(RECT.x1, RECT.y1, RECT.x2 - RECT.x1, RECT.y2 - RECT.y1).scale(g_pHyprOpenGL->m_renderData.pMonitor->m_scale).round());
});
opaque = scaledRegion;
}
// if this intersects the liveBlur region, allow live blur to operate correctly.
// do not occlude a border near it.