summaryrefslogtreecommitdiffstats
path: root/platform/ios
diff options
context:
space:
mode:
authorbruvzg <7645683+bruvzg@users.noreply.github.com>2023-06-12 10:55:26 +0300
committerbruvzg <7645683+bruvzg@users.noreply.github.com>2023-06-12 14:13:53 +0300
commit974a7a89c60e9f186edce82a6f29669abfe997be (patch)
tree496e1937d31e6258c9e8008a920e011e6fea5bed /platform/ios
parent54ab17eb2111604f9d28c09b30083dbdae32d765 (diff)
downloadredot-engine-974a7a89c60e9f186edce82a6f29669abfe997be.tar.gz
[iOS] Fix orientation change in runtime.
Diffstat (limited to 'platform/ios')
-rw-r--r--platform/ios/display_server_ios.mm5
1 files changed, 5 insertions, 0 deletions
diff --git a/platform/ios/display_server_ios.mm b/platform/ios/display_server_ios.mm
index 5637931e73..bfb09b6861 100644
--- a/platform/ios/display_server_ios.mm
+++ b/platform/ios/display_server_ios.mm
@@ -568,6 +568,11 @@ float DisplayServerIOS::screen_get_max_scale() const {
void DisplayServerIOS::screen_set_orientation(DisplayServer::ScreenOrientation p_orientation, int p_screen) {
screen_orientation = p_orientation;
+ if (@available(iOS 16.0, *)) {
+ [AppDelegate.viewController setNeedsUpdateOfSupportedInterfaceOrientations];
+ } else {
+ [UIViewController attemptRotationToDeviceOrientation];
+ }
}
DisplayServer::ScreenOrientation DisplayServerIOS::screen_get_orientation(int p_screen) const {