Fix image scaling (#23641)

Summary:
An updated version of: #22009, this compares the correct image size.

[iOS] [Fixed] - Compare network image sizes correctly
Pull Request resolved: https://github.com/facebook/react-native/pull/23641

Differential Revision: D14210991

Pulled By: hramos

fbshipit-source-id: 079053ef4a8f0e62da6eead9afc8de9285b35966
This commit is contained in:
ericlewis
2019-02-25 11:25:32 -08:00
committed by Facebook Github Bot
parent 972f39985a
commit b758d63bc9

View File

@@ -412,8 +412,8 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init)
return;
}
// Don't reload if the current image size is the maximum size of the image source
CGSize imageSourceSize = _imageSource.size;
// Don't reload if the current image size is the maximum size of either the pending image source or image source
CGSize imageSourceSize = (_imageSource ? _imageSource : _pendingImageSource).size;
if (imageSize.width * imageScale == imageSourceSize.width * _imageSource.scale &&
imageSize.height * imageScale == imageSourceSize.height * _imageSource.scale) {
return;