Răsfoiți Sursa

avoid unnecessary castings

cyberta 5 ani în urmă
părinte
comite
dd0eb7c40a
1 a modificat fișierele cu 1 adăugiri și 1 ștergeri
  1. 1 1
      deltachat-ios/Extensions/UIImage+Extension.swift

+ 1 - 1
deltachat-ios/Extensions/UIImage+Extension.swift

@@ -76,7 +76,7 @@ extension UIImage {
     // the size of PNG imgaes will be scaled down
     func scaleDownAndCompress(toMax: Float) -> UIImage? {
         let rect = getResizedRectangle(toMax: self.isTransparent() ?
-            Float(min(self.size.width / 2, CGFloat(toMax / 2))) :
+            min(Float(self.size.width) / 2, toMax / 2) :
             toMax)
 
         UIGraphicsBeginImageContextWithOptions(rect.size, !self.isTransparent(), 0.0)