fix: Loading images by reverting "bug: Use device scale when loading images.".

fix #509

This reverts commit 5cb5d6bab3.
This commit is contained in:
Dylan Vann 2019-07-02 21:30:13 -04:00
parent ba958f2a45
commit 0326c3ebbb
1 changed files with 3 additions and 10 deletions

View File

@ -69,9 +69,9 @@
- (UIImage*)makeImage:(UIImage *)image withTint:(UIColor *)color {
UIImage *newImage = [image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
UIGraphicsBeginImageContextWithOptions(image.size, NO, 0.0);
UIGraphicsBeginImageContextWithOptions(image.size, NO, newImage.scale);
[color set];
[newImage drawInRect:CGRectMake(0, 0, newImage.size.width, newImage.size.height)];
[newImage drawInRect:CGRectMake(0, 0, image.size.width, newImage.size.height)];
newImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return newImage;
@ -124,7 +124,7 @@
} {
self.hasSentOnLoadStart = NO;
}
UIImage *image = [UIImage imageWithData:[NSData dataWithContentsOfURL:_source.url] scale:[[UIScreen mainScreen] scale]];
UIImage *image = [UIImage imageWithData:[NSData dataWithContentsOfURL:_source.url]];
[self setImage:image];
if (self.onFastImageProgress) {
self.onFastImageProgress(@{
@ -209,13 +209,6 @@
weakSelf.onFastImageLoadEnd(@{});
}
} else {
CGFloat scale = [UIScreen mainScreen].scale;
if (scale > 1.0) {
image = [UIImage imageWithCGImage:[image CGImage] scale: scale orientation:UIImageOrientationUp];
[weakSelf setImage:image];
}
weakSelf.hasCompleted = YES;
[weakSelf sendOnLoad:image];
if (weakSelf.onFastImageLoadEnd) {