mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-16 11:06:49 +01:00
Fixed setting the layer drawable size
Without this change the drawable had a size of 0 and the metal renderer asserted because the projection matrix wasn't set.
This commit is contained in:
parent
cef1c1c2ee
commit
ac2d1f6773
@ -60,7 +60,14 @@
|
||||
/* Set the size of the metal drawables when the view is resized. */
|
||||
- (void)layoutSubviews
|
||||
{
|
||||
CGSize bounds;
|
||||
|
||||
[super layoutSubviews];
|
||||
|
||||
bounds = [self bounds].size;
|
||||
bounds.width *= self.layer.contentsScale;
|
||||
bounds.height *= self.layer.contentsScale;
|
||||
((CAMetalLayer *) self.layer).drawableSize = bounds;
|
||||
}
|
||||
|
||||
@end
|
||||
|
Loading…
Reference in New Issue
Block a user