Browse Source

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

Alex Szpakowski 5 years ago
parent
commit
dd29abb478
1 changed files with 3 additions and 3 deletions
  1. 3 3
      src/video/cocoa/SDL_cocoametalview.m

+ 3 - 3
src/video/cocoa/SDL_cocoametalview.m

@@ -77,8 +77,8 @@
 - (void)updateDrawableSize
 {
     CAMetalLayer *metalLayer = (CAMetalLayer *)self.layer;
-    CGSize size = self.bounds.size;
-    CGSize backingSize = size;
+    NSSize size = self.bounds.size;
+    NSSize backingSize = size;
 
     if (self.highDPI) {
         /* Note: NSHighResolutionCapable must be set to true in the app's
@@ -88,7 +88,7 @@
     }
 
     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. */