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
This commit is contained in:
Vlad Zahorodnii 2021-05-18 19:58:58 +03:00
parent 2ab70d0674
commit 61159d943c

View file

@ -682,11 +682,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