From b43ed85c2afa03b3c9b35710cd2a7407e2a35c1e Mon Sep 17 00:00:00 2001 From: omigamedev Date: Sat, 10 Aug 2019 16:15:07 +0200 Subject: [PATCH] fix iOS screen rotation with keyboard --- PanoPainter/GameViewController.m | 7 ++++--- src/app_events.cpp | 2 +- src/font.cpp | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/PanoPainter/GameViewController.m b/PanoPainter/GameViewController.m index 210ddaa..48610c4 100644 --- a/PanoPainter/GameViewController.m +++ b/PanoPainter/GameViewController.m @@ -227,7 +227,7 @@ std::recursive_mutex lock_mutex; { App::I->redraw = true; App::I->animate = false; - [self unregisterForKeyboardNotifications]; + //[self unregisterForKeyboardNotifications]; } // Called when the UIKeyboardDidShowNotification is sent. @@ -237,7 +237,8 @@ std::recursive_mutex lock_mutex; CGSize kbSize = [[info objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue].size; GameView *view = (GameView *)self.view; - CGRect frame = view.frame; + //CGRect frame = view.frame; + CGRect frame = [[UIScreen mainScreen] bounds]; frame.size.height -= kbSize.height; view.frame = frame; @@ -409,7 +410,7 @@ std::set ignored_touch; { App::I->redraw = true; [self resignFirstResponder]; - //[self registerForKeyboardNotifications]; + [self registerForKeyboardNotifications]; } - (void)viewDidLoad diff --git a/src/app_events.cpp b/src/app_events.cpp index c5d84b7..4c993c2 100644 --- a/src/app_events.cpp +++ b/src/app_events.cpp @@ -95,7 +95,7 @@ void App::showKeyboard() redraw = true; #ifdef __IOS__ dispatch_async(dispatch_get_main_queue(), ^{ - [ios_view registerForKeyboardNotifications]; + //[ios_view registerForKeyboardNotifications]; [ios_view becomeFirstResponder]; }); #elif __ANDROID__ diff --git a/src/font.cpp b/src/font.cpp index 5ede177..8e207cd 100644 --- a/src/font.cpp +++ b/src/font.cpp @@ -12,7 +12,7 @@ Sampler FontManager::m_sampler; bool Font::load(const std::string& ttf, int font_size, float font_scale) { Asset file; - LOG("Font::load %s", ttf); + LOG("Font::load %s", ttf.c_str()); if (file.open(ttf.c_str()) && file.read_all()) { path = ttf;