Skip to content

Commit

Permalink
IOS: Fixes a crash on startup on iOS 7
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent Bénony committed Jan 6, 2016
1 parent c1e664b commit e9934b8
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion backends/platform/iphone/iphone_video.mm
Expand Up @@ -202,7 +202,16 @@ - (CGFloat)optimalScale {
return 1;
}

CGSize screenSize = [[UIScreen mainScreen] nativeBounds].size;
CGSize screenSize;
UIScreen *mainScreen = [UIScreen mainScreen];
if ([mainScreen respondsToSelector:@selector(nativeBounds)]) {
screenSize = [mainScreen nativeBounds].size;
}
else {
screenSize = [mainScreen bounds].size;
screenSize.width *= screenScale;
screenSize.height *= screenScale;
}
CGFloat mxSize = MAX(screenSize.width, screenSize.height);

if (mxSize <= 1136) {
Expand Down

0 comments on commit e9934b8

Please sign in to comment.