From 4c64e94d3990cecaece4402cdda6a4cf4e67d823 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Sun, 26 Oct 2014 13:53:45 +0100 Subject: [PATCH] Fixed X-axis scroll offset inversion (take two). Fixed #239 (properly). --- README.md | 4 ++-- src/cocoa_window.m | 2 +- src/win32_window.c | 2 +- src/x11_window.c | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 0cf76d75..e6c6b361 100644 --- a/README.md +++ b/README.md @@ -106,8 +106,6 @@ GLFW bundles a number of dependencies in the `deps/` directory. bit field was unchanged - [Cocoa] Bugfix: Joystick enumeration took hundreds of ms on some systems - [Cocoa] Bugfix: The cursor was hidden when the user resized a GLFW window - - [Cocoa] Bugfix: The X-axis scroll offsets were inverted relative to the - Windows and X11 ports - [Win32] Enabled generation of pkg-config file for MinGW - [Win32] Removed option to require explicitly linking against `winmm.dll` - [Win32] Bugfix: Failure to load winmm or its functions was not reported to @@ -122,6 +120,7 @@ GLFW bundles a number of dependencies in the `deps/` directory. specified monitor - [Win32] Bugfix: The wrong incorrect physical size was returned for non-primary monitors + - [Win32] Bugfix: X-axis scroll offsets were inverted - [X11] Added run-time support for systems lacking the XKB extension - [X11] Made GLX 1.3 the minimum supported version - [X11] Replaced `XRRGetScreenResources` with `XRRGetScreenResourcesCurrent` @@ -140,6 +139,7 @@ GLFW bundles a number of dependencies in the `deps/` directory. - [X11] Bugfix: The name pointer of joysticks were not cleared on disconnection - [X11] Bugfix: Video mode dimensions were not rotated to match the CRTC - [X11] Bugfix: Unicode character input ignored dead keys + - [X11] Bugfix: X-axis scroll offsets were inverted ## Contact diff --git a/src/cocoa_window.m b/src/cocoa_window.m index dd7b012f..3fec6db0 100644 --- a/src/cocoa_window.m +++ b/src/cocoa_window.m @@ -687,7 +687,7 @@ static int translateKey(unsigned int key) // 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); + _glfwInputScroll(window, deltaX, deltaY); } } diff --git a/src/win32_window.c b/src/win32_window.c index fbdf03ae..a15c38c8 100644 --- a/src/win32_window.c +++ b/src/win32_window.c @@ -728,7 +728,7 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, case WM_MOUSEHWHEEL: { // This message is only sent on Windows Vista and later - _glfwInputScroll(window, (SHORT) HIWORD(wParam) / (double) WHEEL_DELTA, 0.0); + _glfwInputScroll(window, -((SHORT) HIWORD(wParam) / (double) WHEEL_DELTA), 0.0); return 0; } diff --git a/src/x11_window.c b/src/x11_window.c index dfc303fd..8fa6c972 100644 --- a/src/x11_window.c +++ b/src/x11_window.c @@ -949,9 +949,9 @@ static void processEvent(XEvent *event) else if (event->xbutton.button == Button5) _glfwInputScroll(window, 0.0, -1.0); else if (event->xbutton.button == Button6) - _glfwInputScroll(window, -1.0, 0.0); - else if (event->xbutton.button == Button7) _glfwInputScroll(window, 1.0, 0.0); + else if (event->xbutton.button == Button7) + _glfwInputScroll(window, -1.0, 0.0); else {