From 208f94fe12a30474d6805262524da3da492a0990 Mon Sep 17 00:00:00 2001 From: Maximilian Seidler <78690852+PaideiaDilemma@users.noreply.github.com> Date: Thu, 13 Feb 2025 11:08:03 +0000 Subject: [PATCH] animations: sync inactive/active border angles when using borderangle animations (#9401) --- src/render/decorations/CHyprBorderDecoration.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/render/decorations/CHyprBorderDecoration.cpp b/src/render/decorations/CHyprBorderDecoration.cpp index 5f2fdbda2e4..0df3acde478 100644 --- a/src/render/decorations/CHyprBorderDecoration.cpp +++ b/src/render/decorations/CHyprBorderDecoration.cpp @@ -63,6 +63,11 @@ void CHyprBorderDecoration::draw(PHLMONITOR pMonitor, float const& a) { if (m_pWindow->m_fBorderAngleAnimationProgress->enabled()) { grad.m_fAngle += m_pWindow->m_fBorderAngleAnimationProgress->value() * M_PI * 2; grad.m_fAngle = normalizeAngleRad(grad.m_fAngle); + + // When borderangle is animated, it is counterintuitive to fade between inactive/active gradient angles. + // Instead we sync the angles to avoid fading between them and additionally rotating the border angle. + if (ANIMATED) + m_pWindow->m_cRealBorderColorPrevious.m_fAngle = grad.m_fAngle; } int borderSize = m_pWindow->getRealBorderSize();