mirror of
https://github.com/glfw/glfw.git
synced 2026-09-18 14:45:46 +00:00
Fixed OS X scroll X-axis inversion.
When natural scrolling is disabled on OS X, the X-axis of the scroll offsets is inverted compared to the direction on Windows. The X11 scrolling directions are unspecified and so have been aligned with the Windows port. Natural scrolling inverts both axes on both OS X and X11, so the issue remains when the feature is enabled. This inverts the provided X-axis scroll offset, making "unnatural" scroll data align with the Windows and X11 ports and "natual" scroll data be fully inverted and aligned with its counterpart on X11. Fixes #239.
This commit is contained in:
+6
-1
@@ -683,7 +683,12 @@ static int translateKey(unsigned int key)
|
||||
}
|
||||
|
||||
if (fabs(deltaX) > 0.0 || fabs(deltaY) > 0.0)
|
||||
_glfwInputScroll(window, deltaX, deltaY);
|
||||
{
|
||||
// NOTE: The X-axis is inverted for consistency with Windows and X11.
|
||||
// Natural scrolling inverts both axes, making it consistent with
|
||||
// the similarly named feature on modern X11 desktop systems.
|
||||
_glfwInputScroll(window, -deltaX, deltaY);
|
||||
}
|
||||
}
|
||||
|
||||
- (void)resetCursorRects
|
||||
|
||||
Reference in New Issue
Block a user