mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
@@ -184,12 +184,6 @@
|
||||
CGSize imageSizeInPixels = CGSizeMake(imageSize.width * image.scale, imageSize.height * image.scale);
|
||||
CGSize boundsSizeInPixels = CGSizeMake(floorf(bounds.size.width * contentsScale), floorf(bounds.size.height * contentsScale));
|
||||
|
||||
CGImageAlphaInfo alphaInfo = CGImageGetAlphaInfo(image.CGImage);
|
||||
BOOL imageHasAlpha = alphaInfo == kCGImageAlphaFirst
|
||||
|| alphaInfo == kCGImageAlphaLast
|
||||
|| alphaInfo == kCGImageAlphaPremultipliedFirst
|
||||
|| alphaInfo == kCGImageAlphaPremultipliedLast;
|
||||
|
||||
BOOL contentModeSupported = contentMode == UIViewContentModeScaleAspectFill
|
||||
|| contentMode == UIViewContentModeScaleAspectFit
|
||||
|| contentMode == UIViewContentModeCenter;
|
||||
@@ -226,7 +220,7 @@
|
||||
|
||||
// Use contentsScale of 1.0 and do the contentsScale handling in boundsSizeInPixels so ASCroppedImageBackingSizeAndDrawRectInBounds
|
||||
// will do its rounding on pixel instead of point boundaries
|
||||
UIGraphicsBeginImageContextWithOptions(backingSize, !imageHasAlpha, 1.0);
|
||||
UIGraphicsBeginImageContextWithOptions(backingSize, parameters.opaque, 1.0);
|
||||
|
||||
CGContextRef context = UIGraphicsGetCurrentContext();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user