internal: Remake borders as window decorations (#4104)

This commit is contained in:
Vaxry
2023-12-10 16:28:12 +00:00
committed by GitHub
parent b3dc58e104
commit 9f5b9053c6
12 changed files with 201 additions and 78 deletions

View File

@@ -116,13 +116,13 @@ void CHyprDropShadowDecoration::draw(CMonitor* pMonitor, float a, const Vector2D
CBox withDecos = m_bLastWindowBoxWithDecos;
// get window box
windowBox.translate(-pMonitor->vecPosition + WORKSPACEOFFSET).scale(pMonitor->scale).round();
withDecos.translate(-pMonitor->vecPosition + WORKSPACEOFFSET).scale(pMonitor->scale).round();
windowBox.translate(-pMonitor->vecPosition + WORKSPACEOFFSET);
withDecos.translate(-pMonitor->vecPosition + WORKSPACEOFFSET);
auto scaledDecoExtents = withDecos.extentsFrom(windowBox).round();
auto extentss = withDecos.extentsFrom(windowBox);
// add extents
windowBox.addExtents(scaledDecoExtents).round();
windowBox.addExtents(extentss).scale(pMonitor->scale).round();
if (windowBox.width < 1 || windowBox.height < 1)
return; // prevent assert failed
@@ -159,7 +159,7 @@ void CHyprDropShadowDecoration::draw(CMonitor* pMonitor, float a, const Vector2D
g_pHyprOpenGL->m_RenderData.damage = saveDamage;
} else {
g_pHyprOpenGL->renderRoundedShadow(&fullBox, ROUNDING * pMonitor->scale, *PSHADOWSIZE * pMonitor->scale, a);
g_pHyprOpenGL->renderRoundedShadow(&fullBox, ROUNDING * pMonitor->scale, *PSHADOWSIZE * pMonitor->scale, m_pWindow->m_cRealShadowColor.col(), a);
}
if (m_seExtents != m_seReportedExtents)