Kaynağa Gözat

Reapply should change checking

onevcat 2 yıl önce
ebeveyn
işleme
4177bac5e9
1 değiştirilmiş dosya ile 7 ekleme ve 9 silme
  1. 7 9
      Sources/Views/AnimatedImageView.swift

+ 7 - 9
Sources/Views/AnimatedImageView.swift

@@ -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
         }
     }
 }