From c416880cf96aee783b6a00f356512e5d758e6056 Mon Sep 17 00:00:00 2001 From: vaxerski Date: Fri, 22 Dec 2023 19:54:18 +0100 Subject: shadow: correctly scale boxes --- src/render/decorations/CHyprDropShadowDecoration.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/render/decorations/CHyprDropShadowDecoration.cpp b/src/render/decorations/CHyprDropShadowDecoration.cpp index 5e70b639..0f848c61 100644 --- a/src/render/decorations/CHyprDropShadowDecoration.cpp +++ b/src/render/decorations/CHyprDropShadowDecoration.cpp @@ -119,10 +119,12 @@ void CHyprDropShadowDecoration::draw(CMonitor* pMonitor, float a, const Vector2D windowBox.translate(-pMonitor->vecPosition + WORKSPACEOFFSET); withDecos.translate(-pMonitor->vecPosition + WORKSPACEOFFSET); - auto extentss = withDecos.extentsFrom(windowBox); + auto scaledExtentss = withDecos.extentsFrom(windowBox); + scaledExtentss = scaledExtentss * pMonitor->scale; + scaledExtentss = scaledExtentss.round(); // add extents - windowBox.addExtents(extentss).scale(pMonitor->scale).round(); + windowBox.scale(pMonitor->scale).round().addExtents(scaledExtentss); if (windowBox.width < 1 || windowBox.height < 1) return; // prevent assert failed -- cgit v1.2.3