Properly send a window resize event in all cases when viewDidLayoutSubviews is triggered. iOS-improvements
authorAlex Szpakowski <slime73@gmail.com>
Thu, 17 Jul 2014 18:05:12 -0300
branchiOS-improvements
changeset 9494 435b95e7b712
parent 9493 961d593034b5
child 9495 76e878c8ca80
Properly send a window resize event in all cases when viewDidLayoutSubviews is triggered.
src/video/uikit/SDL_uikitviewcontroller.m
--- a/src/video/uikit/SDL_uikitviewcontroller.m	Wed Jul 16 21:06:15 2014 -0300
+++ b/src/video/uikit/SDL_uikitviewcontroller.m	Thu Jul 17 18:05:12 2014 -0300
@@ -56,14 +56,12 @@
 
 - (void)viewDidLayoutSubviews
 {
-    if (window->flags & SDL_WINDOW_RESIZABLE) {
-        SDL_WindowData *data = window->driverdata;
-        const CGSize size = data->view.bounds.size;
-        int w = (int) size.width;
-        int h = (int) size.height;
+    SDL_WindowData *data = window->driverdata;
+    const CGSize size = data->view.bounds.size;
+    int w = (int) size.width;
+    int h = (int) size.height;
 
-        SDL_SendWindowEvent(self->window, SDL_WINDOWEVENT_RESIZED, w, h);
-    }
+    SDL_SendWindowEvent(window, SDL_WINDOWEVENT_RESIZED, w, h);
 }
 
 - (NSUInteger)supportedInterfaceOrientations
@@ -91,7 +89,7 @@
         }
     }
 
-    if (orientationMask == 0 && window->flags & SDL_WINDOW_RESIZABLE) {
+    if (orientationMask == 0 && (window->flags & SDL_WINDOW_RESIZABLE)) {
         orientationMask = UIInterfaceOrientationMaskAll;  /* any orientation is okay. */
     }