Commit 9169445b authored by Vlad Zahorodnii's avatar Vlad Zahorodnii Committed by Nate Graham
Browse files

effects: Fix interpolated values for redirected animations

If a redirected animation reaches the end, the timeline value will be 0,
i.e. the interpolated() function has to return the from value, not `to`.

BUG: 438368


(cherry picked from commit 61159d94)
parent c5b07a65
......@@ -727,11 +727,7 @@ void AnimationEffect::postPaintScreen()
float AnimationEffect::interpolated( const AniData &a, int i ) const
{
if (a.startTime > clock())
return a.from[i];
if (!a.timeLine.done())
return a.from[i] + a.timeLine.value() * (a.to[i] - a.from[i]);
return a.to[i]; // we're done and "waiting" at the target value
return a.from[i] + a.timeLine.value() * (a.to[i] - a.from[i]);
}
float AnimationEffect::progress( const AniData &a ) const
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment