diff --git a/Source/animation/PathAnimation.swift b/Source/animation/PathAnimation.swift index b8ded075..11f8aa04 100644 --- a/Source/animation/PathAnimation.swift +++ b/Source/animation/PathAnimation.swift @@ -49,9 +49,10 @@ public class PathAnimation: Animatable { var path = [AnimationPathFrame]() // 60 fps - let fps = 60 - let dt = 1.0 / Double(fps) - for i in 0 ... 59 { + let fps = 60.0 + let n = fps * animationDuration + let dt = 1.0 / n + for i in 0 ... Int(n) { let position = dt * Double(i) let value = function(position) path.append(AnimationPathFrame(value: value, position: position))