mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-25 17:52:02 +02:00
Make the scale sanitization more comprehensive
This commit is contained in:
@@ -386,9 +386,9 @@ get_window_content_scale(GLFWwindow *w, float *xscale, float *yscale, double *xd
|
|||||||
GLFWmonitor *monitor = glfwGetPrimaryMonitor();
|
GLFWmonitor *monitor = glfwGetPrimaryMonitor();
|
||||||
if (monitor) glfwGetMonitorContentScale(monitor, xscale, yscale);
|
if (monitor) glfwGetMonitorContentScale(monitor, xscale, yscale);
|
||||||
}
|
}
|
||||||
// check for zero or NaN values of xscale/yscale
|
// check for zero, negative, NaN or excessive values of xscale/yscale
|
||||||
if (!*xscale || *xscale != *xscale) *xscale = 1.0;
|
if (*xscale <= 0 || *xscale != *xscale || *xscale >= 24) *xscale = 1.0;
|
||||||
if (!*yscale || *yscale != *yscale) *yscale = 1.0;
|
if (*yscale <= 0 || *yscale != *yscale || *yscale >= 24) *yscale = 1.0;
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
const double factor = 72.0;
|
const double factor = 72.0;
|
||||||
#else
|
#else
|
||||||
|
|||||||
Reference in New Issue
Block a user