mirror of
https://github.com/glfw/glfw.git
synced 2026-09-19 15:25:50 +00:00
Fixed X-axis scroll offset inversion (take two).
Fixed #239 (properly).
This commit is contained in:
+1
-1
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user