round scale up to 1.0 if it's > 0.9

This commit is contained in:
Jesús A. Álvarez 2017-11-30 20:35:38 +01:00
parent 97ab910a84
commit 097ac4e64d

View File

@ -52,6 +52,9 @@ static ScreenView *sharedScreenView = nil;
[super layoutSubviews]; [super layoutSubviews];
CGRect viewBounds = self.bounds; CGRect viewBounds = self.bounds;
CGFloat screenScale = MAX(screenSize.width / viewBounds.size.width, screenSize.height / viewBounds.size.height); CGFloat screenScale = MAX(screenSize.width / viewBounds.size.width, screenSize.height / viewBounds.size.height);
if (screenScale > 0.9 && screenScale <= 1.0) {
screenScale = 1.0;
}
screenBounds = CGRectMake(0, 0, screenSize.width / screenScale, screenSize.height / screenScale); screenBounds = CGRectMake(0, 0, screenSize.width / screenScale, screenSize.height / screenScale);
screenBounds.origin.x = (viewBounds.size.width - screenBounds.size.width)/2; screenBounds.origin.x = (viewBounds.size.width - screenBounds.size.width)/2;
screenBounds = CGRectIntegral(screenBounds); screenBounds = CGRectIntegral(screenBounds);