mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-08 22:28:24 +02:00
macOS: Fix resize_in_steps not working correctly on high DPI screens
See #4114
This commit is contained in:
@@ -1875,10 +1875,13 @@ void _glfwPlatformSetWindowAspectRatio(_GLFWwindow* window, int numer, int denom
|
||||
|
||||
void _glfwPlatformSetWindowSizeIncrements(_GLFWwindow* window, int widthincr, int heightincr)
|
||||
{
|
||||
if (widthincr != GLFW_DONT_CARE && heightincr != GLFW_DONT_CARE)
|
||||
[window->ns.object setResizeIncrements:NSMakeSize(widthincr, heightincr)];
|
||||
else
|
||||
if (widthincr != GLFW_DONT_CARE && heightincr != GLFW_DONT_CARE) {
|
||||
float xscale = 1, yscale = 1;
|
||||
_glfwPlatformGetWindowContentScale(window, &xscale, &yscale);
|
||||
[window->ns.object setResizeIncrements:NSMakeSize(widthincr / xscale, heightincr / yscale)];
|
||||
} else {
|
||||
[window->ns.object setResizeIncrements:NSMakeSize(1.0, 1.0)];
|
||||
}
|
||||
}
|
||||
|
||||
void _glfwPlatformGetFramebufferSize(_GLFWwindow* window, int* width, int* height)
|
||||
|
||||
Reference in New Issue
Block a user