Skip to content

Commit

Permalink
Reapply should change checking
Browse files Browse the repository at this point in the history
  • Loading branch information
onevcat committed Jan 13, 2024
1 parent e542964 commit 4177bac
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions Sources/Views/AnimatedImageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -460,15 +460,13 @@ open class AnimatedImageView: KFCrossPlatformImageView {
// Some devices (like iPad Pro 10.5) will have a different FPS.
duration = 1.0 / TimeInterval(preferredFramesPerSecond)
}

animator.shouldChangeFrame(with: duration) { [weak self] hasNewFrame in
if hasNewFrame {
#if os(macOS)
self?.layer?.setNeedsDisplay()
#else
self?.layer.setNeedsDisplay()
#endif
}

if animator.shouldChangeFrame(with: duration) {
#if os(macOS)
layer?.setNeedsDisplay()
#else
layer.setNeedsDisplay()
#endif
}
}
}
Expand Down

0 comments on commit 4177bac

Please sign in to comment.