diff options
Diffstat (limited to 'src/managers/animation/AnimationManager.cpp')
| -rw-r--r-- | src/managers/animation/AnimationManager.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/managers/animation/AnimationManager.cpp b/src/managers/animation/AnimationManager.cpp index 687f5f2c..c5c3ca54 100644 --- a/src/managers/animation/AnimationManager.cpp +++ b/src/managers/animation/AnimationManager.cpp @@ -42,7 +42,7 @@ static void updateVariable(CAnimatedVariable<VarType>& av, const float POINTY, b av.value() = av.begun() + DELTA * POINTY; } -static void updateColorVariable(CAnimatedVariable<CHyprColor>& av, const float POINTY, bool warp) { +static void updateColorVariable(CAnimatedVariable<CHyprColor>& av, const float POINTY, bool warp = false) { if (warp || av.value() == av.goal()) { av.warp(true, false); return; @@ -139,15 +139,12 @@ static void handleUpdate(CAnimatedVariable<VarType>& av, bool warp) { animationsDisabled = animationsDisabled || ls->m_ruleApplicator->noanim().valueOrDefault(); } - 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; + const auto STEP = av.getCurveStep(); if constexpr (std::same_as<VarType, CHyprColor>) - updateColorVariable(av, POINTY, WARP); + updateColorVariable(av, STEP.value, STEP.finished); else - updateVariable<VarType>(av, POINTY, WARP); + updateVariable<VarType>(av, STEP.value, STEP.finished); av.onUpdate(); } |
