Sfoglia il codice sorgente

Consider screen scale when pre-resizing GIF frames

onevcat 7 anni fa
parent
commit
5011a21a99
1 ha cambiato i file con 2 aggiunte e 1 eliminazioni
  1. 2 1
      Sources/Views/AnimatedImageView.swift

+ 2 - 1
Sources/Views/AnimatedImageView.swift

@@ -241,10 +241,11 @@ open class AnimatedImageView: UIImageView {
     private func reset() {
         animator = nil
         if let imageSource = image?.kf.imageSource {
+            let targetSize = bounds.scaled(UIScreen.main.scale).size
             let animator = Animator(
                 imageSource: imageSource,
                 contentMode: contentMode,
-                size: bounds.size,
+                size: targetSize,
                 framePreloadCount: framePreloadCount,
                 repeatCount: repeatCount,
                 preloadQueue: preloadQueue)