1
1
mirror of https://github.com/exyte/Macaw.git synced 2024-10-10 19:37:32 +03:00

Path by function animation fps fix

This commit is contained in:
Victor Sukochev 2016-04-06 15:41:34 +06:00
parent 33e29b7120
commit 9dc0761d1d

View File

@ -49,9 +49,10 @@ public class PathAnimation<T: Interpolable>: Animatable {
var path = [AnimationPathFrame<T>]()
// 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))