Просмотр исходного кода

UIImage scaling: prevent unwanted black borders on resized imagery

Felix Paul Kühne 10 лет назад
Родитель
Сommit
0de02cdb41
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      Sources/UIImage+Scaling.m

+ 1 - 1
Sources/UIImage+Scaling.m

@@ -36,7 +36,7 @@
 
     CGContextSetInterpolationQuality(contextRef, kCGInterpolationLow);
 
-    CGContextDrawImage(contextRef, destinationRect, cgImage);
+    CGContextDrawImage(contextRef, (CGRect){CGPointZero, destinationRect.size}, cgImage);
 
     return [UIImage imageWithCGImage:CGBitmapContextCreateImage(contextRef)];
 }