Commit df7f3727 by Orkhan Alikhanov

Fixed resume time was calculated incorrectly

There is no need to recalculate duration from the current state
of the view. Motion calculates it when animations is first fired off
and on resume remaining duration can be recalculated
as usual (duration - progress).
parent ee6152e3
......@@ -127,10 +127,6 @@ internal class MotionCoreAnimator<T: MotionAnimatorViewContext>: MotionAnimator
var duration: TimeInterval = 0
for (_, v) in viewToContexts {
if nil == v.targetState.duration {
v.duration = max(v.duration, v.snapshot.optimizedDuration(targetState: v.targetState) + progress)
}
duration = max(duration, v.resume(at: progress, isReversed: isReversed))
}
......
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