mirror of https://github.com/encounter/SDL.git
Properly send a window resize event in all cases when viewDidLayoutSubviews is triggered.
This commit is contained in:
parent
b55be6e7bd
commit
d2e445d7bb
|
@ -56,14 +56,12 @@
|
||||||
|
|
||||||
- (void)viewDidLayoutSubviews
|
- (void)viewDidLayoutSubviews
|
||||||
{
|
{
|
||||||
if (window->flags & SDL_WINDOW_RESIZABLE) {
|
|
||||||
SDL_WindowData *data = window->driverdata;
|
SDL_WindowData *data = window->driverdata;
|
||||||
const CGSize size = data->view.bounds.size;
|
const CGSize size = data->view.bounds.size;
|
||||||
int w = (int) size.width;
|
int w = (int) size.width;
|
||||||
int h = (int) size.height;
|
int h = (int) size.height;
|
||||||
|
|
||||||
SDL_SendWindowEvent(self->window, SDL_WINDOWEVENT_RESIZED, w, h);
|
SDL_SendWindowEvent(window, SDL_WINDOWEVENT_RESIZED, w, h);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSUInteger)supportedInterfaceOrientations
|
- (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. */
|
orientationMask = UIInterfaceOrientationMaskAll; /* any orientation is okay. */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue