From e66eab7b6a90514251439f661454c536afa3e5c8 Mon Sep 17 00:00:00 2001 From: Maximilian Seidler <78690852+PaideiaDilemma@users.noreply.github.com> Date: Thu, 9 Jan 2025 11:13:47 +0000 Subject: [PATCH] animationmgr: don't warp based on POINTY value (#9000) --- src/managers/AnimationManager.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/managers/AnimationManager.cpp b/src/managers/AnimationManager.cpp index c1ea1d27..f0f6a980 100644 --- a/src/managers/AnimationManager.cpp +++ b/src/managers/AnimationManager.cpp @@ -40,7 +40,7 @@ CHyprAnimationManager::CHyprAnimationManager() { template void updateVariable(CAnimatedVariable& av, const float POINTY, bool warp = false) { - if (POINTY >= 1.f || warp || av.value() == av.goal()) { + if (warp || av.value() == av.goal()) { av.warp(); return; } @@ -50,7 +50,7 @@ void updateVariable(CAnimatedVariable& av, const float POINTY, bool war } void updateColorVariable(CAnimatedVariable& av, const float POINTY, bool warp) { - if (POINTY >= 1.f || warp || av.value() == av.goal()) { + if (warp || av.value() == av.goal()) { av.warp(); return; } @@ -146,11 +146,12 @@ static void handleUpdate(CAnimatedVariable& av, bool warp) { const auto SPENT = av.getPercent(); const auto PBEZIER = g_pAnimationManager->getBezier(av.getBezierName()); const auto POINTY = PBEZIER->getYForPoint(SPENT); + const bool WARP = animationsDisabled || SPENT >= 1.f; if constexpr (std::same_as) - updateColorVariable(av, POINTY, animationsDisabled); + updateColorVariable(av, POINTY, WARP); else - updateVariable(av, POINTY, animationsDisabled); + updateVariable(av, POINTY, WARP); av.onUpdate();