Skip to content

Commit

Permalink
fix: Xcode 16 has broken the way we calculate the distance
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Bødskov committed Sep 19, 2024
1 parent 4fb7e38 commit be87817
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ class SpringAnimator: NSObject {
private extension SpringAnimator {
@objc func step(displayLink: CADisplayLink) {
// Get duration in a way that supports screens with variable refresh rates
let duration = displayLink.targetTimestamp - CACurrentMediaTime()
// Calculate new potision
let duration = displayLink.targetTimestamp - displayLink.timestamp
// Calculate new position
position += velocity * CGFloat(duration)
let acceleration = -velocity * damping - position * stiffness
velocity += acceleration * CGFloat(duration)
Expand Down

0 comments on commit be87817

Please sign in to comment.