shadow: correctly scale boxes

This commit is contained in:
Vaxry 2023-12-22 19:54:18 +01:00
parent 37d2840246
commit c416880cf9

View file

@ -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