Fixed view frame from flipping back and forth between landscape and portrait on iOS

main
Sam Lantinga 2023-02-23 09:14:53 -08:00
parent e8fd7f74bd
commit b2d913883c
1 changed files with 2 additions and 1 deletions

View File

@ -204,7 +204,8 @@ UIKit_ComputeViewFrame(SDL_Window *window, UIScreen *screen)
* https://bugzilla.libsdl.org/show_bug.cgi?id=3465 * https://bugzilla.libsdl.org/show_bug.cgi?id=3465
* https://forums.developer.apple.com/thread/65337 */ * https://forums.developer.apple.com/thread/65337 */
UIInterfaceOrientation orient = [UIApplication sharedApplication].statusBarOrientation; UIInterfaceOrientation orient = [UIApplication sharedApplication].statusBarOrientation;
BOOL landscape = UIInterfaceOrientationIsLandscape(orient); BOOL landscape = UIInterfaceOrientationIsLandscape(orient) ||
!(UIKit_GetSupportedOrientations(window) & (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown));
BOOL fullscreen = CGRectEqualToRect(screen.bounds, frame); BOOL fullscreen = CGRectEqualToRect(screen.bounds, frame);
/* The orientation flip doesn't make sense when the window is smaller /* The orientation flip doesn't make sense when the window is smaller