mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-09 11:20:56 +00:00
IOS7: Update current orientation before animation completes
The overided viewWillTransitionToSize instance method did update the current orientation when animation to the new orientation completed. However, that made the handling of safe areas on devices having such, e.g. iPhones with the sensor bar on top, racy. The correct orientation was set after the adjustViewFrameForSafeArea function was called. Set the new orientation before the animation completes.
This commit is contained in:
parent
34d7cd3769
commit
1b3c783b9e
@ -88,14 +88,11 @@
|
||||
|
||||
- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
|
||||
[super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
|
||||
|
||||
[coordinator animateAlongsideTransition:nil completion:^(id<UIViewControllerTransitionCoordinatorContext> context) {
|
||||
UIInterfaceOrientation orientationAfter = [self interfaceOrientation];
|
||||
if (orientationAfter != UIInterfaceOrientationUnknown && orientationAfter != currentOrientation) {
|
||||
currentOrientation = orientationAfter;
|
||||
[[iOS7AppDelegate iPhoneView] interfaceOrientationChanged:currentOrientation];
|
||||
}
|
||||
}];
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user