Răsfoiți Sursa

Format code

alex.huo 7 ani în urmă
părinte
comite
2e0cc320b3
1 a modificat fișierele cu 4 adăugiri și 1 ștergeri
  1. 4 1
      Sources/Image/ImageDrawing.swift

+ 4 - 1
Sources/Image/ImageDrawing.swift

@@ -560,7 +560,10 @@ extension KingfisherWrapper where Base: CGImage {
     public func resize(to size: CGSize) -> CGImage {
     public func resize(to size: CGSize) -> CGImage {
         let alphaInfo = base.alphaInfo.rawValue & CGBitmapInfo.alphaInfoMask.rawValue
         let alphaInfo = base.alphaInfo.rawValue & CGBitmapInfo.alphaInfoMask.rawValue
         var hasAlpha = false
         var hasAlpha = false
-        if alphaInfo == CGImageAlphaInfo.premultipliedLast.rawValue || alphaInfo == CGImageAlphaInfo.premultipliedFirst.rawValue || alphaInfo == CGImageAlphaInfo.first.rawValue || alphaInfo == CGImageAlphaInfo.last.rawValue {
+        if alphaInfo == CGImageAlphaInfo.premultipliedLast.rawValue
+            || alphaInfo == CGImageAlphaInfo.premultipliedFirst.rawValue
+            || alphaInfo == CGImageAlphaInfo.first.rawValue
+            || alphaInfo == CGImageAlphaInfo.last.rawValue {
             hasAlpha = true
             hasAlpha = true
         }
         }