Skip to content

Commit

Permalink
Properly send a window resize event in all cases when viewDidLayoutSu…
Browse files Browse the repository at this point in the history
…bviews is triggered.
  • Loading branch information
slime73 committed Jul 17, 2014
1 parent b55be6e commit d2e445d
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/video/uikit/SDL_uikitviewcontroller.m
Expand Up @@ -56,14 +56,12 @@ - (void)loadView

- (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
Expand Down Expand Up @@ -91,7 +89,7 @@ - (NSUInteger)supportedInterfaceOrientations
}
}

if (orientationMask == 0 && window->flags & SDL_WINDOW_RESIZABLE) {
if (orientationMask == 0 && (window->flags & SDL_WINDOW_RESIZABLE)) {
orientationMask = UIInterfaceOrientationMaskAll; /* any orientation is okay. */
}

Expand Down

0 comments on commit d2e445d

Please sign in to comment.