macOS: Fix touch scrolling sensitivity low on retina screens

Fixes #1112
This commit is contained in:
Kovid Goyal
2018-11-04 12:07:55 +05:30
parent be6556c884
commit 82f9aecacb
2 changed files with 7 additions and 0 deletions

View File

@@ -902,6 +902,11 @@ is_ascii_control_char(char x) {
deltaX = [event scrollingDeltaX];
deltaY = [event scrollingDeltaY];
int flags = [event hasPreciseScrollingDeltas] ? 1 : 0;
if (flags) {
float xscale = 1, yscale = 1;
_glfwPlatformGetWindowContentScale(window, &xscale, &yscale);
if (yscale > 0) deltaY *= yscale;
}
if (fabs(deltaX) > 0.0 || fabs(deltaY) > 0.0)
_glfwInputScroll(window, deltaX, deltaY, flags);