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;
|
||||
[data->uiscreen setCurrentMode:modedata->uiscreenmode];
|
||||
|
||||
CGSize size = [modedata->uiscreenmode size];
|
||||
if (size.width >= size.height) {
|
||||
[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight animated:NO];
|
||||
} else {
|
||||
[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortrait animated:NO];
|
||||
if (mode->w > mode->h) {
|
||||
if (!UIInterfaceOrientationIsLandscape([[UIApplication sharedApplication] statusBarOrientation]))
|
||||
[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight animated:NO];
|
||||
} else if (mode->w < mode->h) {
|
||||
if (!UIInterfaceOrientationIsPortrait([[UIApplication sharedApplication] statusBarOrientation]))
|
||||
[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortrait animated:NO];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue