From 2884915000b9fee580713864254dc4fd1b377b45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Tue, 20 Mar 2018 18:33:35 +0100 Subject: [PATCH] Cocoa: Set CAMetalLayer contents scale from window Fixes #1229. --- src/cocoa_window.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/cocoa_window.m b/src/cocoa_window.m index a4094a3f..a54624cc 100644 --- a/src/cocoa_window.m +++ b/src/cocoa_window.m @@ -582,6 +582,9 @@ static const NSRange kEmptyRange = { NSNotFound, 0 }; window->ns.xscale = xscale; window->ns.yscale = yscale; _glfwInputWindowContentScale(window, xscale, yscale); + + if (window->ns.layer) + [window->ns.layer setContentsScale:[window->ns.object backingScaleFactor]]; } } @@ -1871,6 +1874,7 @@ VkResult _glfwPlatformCreateWindowSurface(VkInstance instance, return VK_ERROR_EXTENSION_NOT_PRESENT; } + [window->ns.layer setContentsScale:[window->ns.object backingScaleFactor]]; [window->ns.view setWantsLayer:YES]; memset(&sci, 0, sizeof(sci));