macOS: Use the proper type (NSSize instead of CGSize) for the bounds of metal views.

This commit is contained in:
Alex Szpakowski 2019-08-22 19:23:52 -03:00
parent 2937317f12
commit dd29abb478

View File

@ -77,8 +77,8 @@
- (void)updateDrawableSize - (void)updateDrawableSize
{ {
CAMetalLayer *metalLayer = (CAMetalLayer *)self.layer; CAMetalLayer *metalLayer = (CAMetalLayer *)self.layer;
CGSize size = self.bounds.size; NSSize size = self.bounds.size;
CGSize backingSize = size; NSSize backingSize = size;
if (self.highDPI) { if (self.highDPI) {
/* Note: NSHighResolutionCapable must be set to true in the app's /* Note: NSHighResolutionCapable must be set to true in the app's
@ -88,7 +88,7 @@
} }
metalLayer.contentsScale = backingSize.height / size.height; metalLayer.contentsScale = backingSize.height / size.height;
metalLayer.drawableSize = backingSize; metalLayer.drawableSize = NSSizeToCGSize(backingSize);
} }
/* Set the size of the metal drawables when the view is resized. */ /* Set the size of the metal drawables when the view is resized. */