Skip to content

Commit 208f94f

Browse files
animations: sync inactive/active border angles when using borderangle animations (#9401)
1 parent 1789405 commit 208f94f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/render/decorations/CHyprBorderDecoration.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ void CHyprBorderDecoration::draw(PHLMONITOR pMonitor, float const& a) {
6363
if (m_pWindow->m_fBorderAngleAnimationProgress->enabled()) {
6464
grad.m_fAngle += m_pWindow->m_fBorderAngleAnimationProgress->value() * M_PI * 2;
6565
grad.m_fAngle = normalizeAngleRad(grad.m_fAngle);
66+
67+
// When borderangle is animated, it is counterintuitive to fade between inactive/active gradient angles.
68+
// Instead we sync the angles to avoid fading between them and additionally rotating the border angle.
69+
if (ANIMATED)
70+
m_pWindow->m_cRealBorderColorPrevious.m_fAngle = grad.m_fAngle;
6671
}
6772

6873
int borderSize = m_pWindow->getRealBorderSize();

0 commit comments

Comments
 (0)