Only change the UI orientation if it's actually necessary for the mode.
This commit is contained in:
parent
52780b8ca7
commit
9b357d17de
1 changed files with 6 additions and 5 deletions
|
@ -357,11 +357,12 @@ UIKit_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode)
|
||||||
SDL_DisplayModeData *modedata = (SDL_DisplayModeData *)mode->driverdata;
|
SDL_DisplayModeData *modedata = (SDL_DisplayModeData *)mode->driverdata;
|
||||||
[data->uiscreen setCurrentMode:modedata->uiscreenmode];
|
[data->uiscreen setCurrentMode:modedata->uiscreenmode];
|
||||||
|
|
||||||
CGSize size = [modedata->uiscreenmode size];
|
if (mode->w > mode->h) {
|
||||||
if (size.width >= size.height) {
|
if (!UIInterfaceOrientationIsLandscape([[UIApplication sharedApplication] statusBarOrientation]))
|
||||||
[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight animated:NO];
|
[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight animated:NO];
|
||||||
} else {
|
} else if (mode->w < mode->h) {
|
||||||
[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortrait animated:NO];
|
if (!UIInterfaceOrientationIsPortrait([[UIApplication sharedApplication] statusBarOrientation]))
|
||||||
|
[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortrait animated:NO];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue