Respect opacity of ASImageNode

fixes #284
This commit is contained in:
Ryan Nystrom
2015-02-03 19:53:59 -08:00
parent 3b8de5cf52
commit 1752c724fe

View File

@@ -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();