cmd/ebitenmobile: Bug fix: iOS view was not shown

This enbugs that garbages are rendered outside the screen. I think
the bug in iPad is now exposed to any iOS devices.

Updates #1019
This commit is contained in:
Hajime Hoshi 2020-02-11 20:20:13 +09:00
parent c927d33457
commit 38d8cbf6af
2 changed files with 10 additions and 1 deletions

View File

@ -216,6 +216,15 @@ const objcM = `// Code generated by ebitenmobile. DO NOT EDIT.
[displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
}
- (void)viewWillLayoutSubviews {
CGRect viewRect = [[self view] frame];
#if EBITEN_METAL
[[self metalView] setFrame:viewRect];
#else
[[self glkView] setFrame:viewRect];
#endif
}
- (void)viewDidLayoutSubviews {
[super viewDidLayoutSubviews];
CGRect viewRect = [[self view] frame];

File diff suppressed because one or more lines are too long