Skip to content

Commit

Permalink
macOS: Use the proper type (NSSize instead of CGSize) for the bounds …
Browse files Browse the repository at this point in the history
…of metal views.
  • Loading branch information
slime73 committed Aug 22, 2019
1 parent 2937317 commit dd29abb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/video/cocoa/SDL_cocoametalview.m
Expand Up @@ -77,8 +77,8 @@ - (NSInteger)tag
- (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
Expand All @@ -88,7 +88,7 @@ - (void)updateDrawableSize
}

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. */
Expand Down

0 comments on commit dd29abb

Please sign in to comment.