summaryrefslogtreecommitdiff
path: root/src/render/decorations
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2023-12-10 19:32:03 +0000
committerVaxry <vaxry@vaxry.net>2023-12-10 19:32:03 +0000
commit167f2ed3b2bb18ceeabb831ac80b655ef8e16867 (patch)
treead9e2c5c869a5140c2dfdaf97de8024d4849236d /src/render/decorations
parentd02ba422daae97498ffe6cdf84914b74ddf1fd44 (diff)
border: fix failed assert on small windows
fixes #4115
Diffstat (limited to 'src/render/decorations')
-rw-r--r--src/render/decorations/CHyprBorderDecoration.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/render/decorations/CHyprBorderDecoration.cpp b/src/render/decorations/CHyprBorderDecoration.cpp
index 560eb8ca..4b3abd8c 100644
--- a/src/render/decorations/CHyprBorderDecoration.cpp
+++ b/src/render/decorations/CHyprBorderDecoration.cpp
@@ -51,6 +51,11 @@ void CHyprBorderDecoration::draw(CMonitor* pMonitor, float a, const Vector2D& of
if (m_bAssignedGeometry.width < m_seExtents.topLeft.x + 1 || m_bAssignedGeometry.height < m_seExtents.topLeft.y + 1)
return;
+ CBox windowBox = assignedBoxGlobal().translate(-pMonitor->vecPosition).expand(-m_pWindow->getRealBorderSize()).scale(pMonitor->scale).round();
+
+ if (windowBox.width < 1 || windowBox.height < 1)
+ return;
+
auto grad = m_pWindow->m_cRealBorderColor;
const bool ANIMATED = m_pWindow->m_fBorderFadeAnimationProgress.isBeingAnimated();
float a1 = a * (ANIMATED ? m_pWindow->m_fBorderFadeAnimationProgress.fl() : 1.f);
@@ -60,8 +65,6 @@ void CHyprBorderDecoration::draw(CMonitor* pMonitor, float a, const Vector2D& of
grad.m_fAngle = normalizeAngleRad(grad.m_fAngle);
}
- CBox windowBox = assignedBoxGlobal().translate(-pMonitor->vecPosition).expand(-m_pWindow->getRealBorderSize()).scale(pMonitor->scale).round();
-
int borderSize = m_pWindow->getRealBorderSize();
const auto ROUNDING = m_pWindow->rounding() * pMonitor->scale;