Преглед изворни кода

Ignoring resizing animated frame when size is zero

xspyhack пре 6 година
родитељ
комит
7cb1b1a965
1 измењених фајлова са 2 додато и 1 уклоњено
  1. 2 1
      Sources/Views/AnimatedImageView.swift

+ 2 - 1
Sources/Views/AnimatedImageView.swift

@@ -503,9 +503,10 @@ extension AnimatedImageView {
                 kCGImageSourceThumbnailMaxPixelSize: max(size.width, size.height)
                 kCGImageSourceThumbnailMaxPixelSize: max(size.width, size.height)
             ]
             ]
 
 
+            let resize = needsPrescaling && size != .zero
             guard let cgImage = CGImageSourceCreateImageAtIndex(imageSource,
             guard let cgImage = CGImageSourceCreateImageAtIndex(imageSource,
                                                                 index,
                                                                 index,
-                                                                needsPrescaling ? options as CFDictionary : nil) else {
+                                                                resize ? options as CFDictionary : nil) else {
                 return nil
                 return nil
             }
             }