From f760b124ca849d99effbedb91fb8d10a828aea00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Wed, 15 Jul 2020 23:11:19 +0200 Subject: [PATCH] Wayland: Fix scroll offsets being inverted Scrolling offsets were inverted compared to X11 and Win32. Fixes #1463. --- README.md | 3 +++ src/wl_init.c | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1264aa69..1cec365e 100644 --- a/README.md +++ b/README.md @@ -199,6 +199,8 @@ information on what to include when reporting a bug. - [Wayland] Bugfix: `CLOCK_MONOTONIC` was not correctly enabled - [Wayland] Bugfix: Repeated keys could be reported with `NULL` window (#1704) - [Wayland] Bugfix: Retrieving partial framebuffer size would segfault + - [Wayland] Bugfix: Scrolling offsets were inverted compared to other platforms + (#1463) - [POSIX] Bugfix: `CLOCK_MONOTONIC` was not correctly tested for or enabled - [NSGL] Removed enforcement of forward-compatible flag for core contexts - [NSGL] Bugfix: `GLFW_COCOA_RETINA_FRAMEBUFFER` had no effect on newer @@ -345,6 +347,7 @@ skills. - ndogxj - Kristian Nielsen - Kamil Nowakowski + - onox - Denis Ovod - Ozzy - Andri Pálsson diff --git a/src/wl_init.c b/src/wl_init.c index 558ff8a8..bc44c88e 100644 --- a/src/wl_init.c +++ b/src/wl_init.c @@ -341,9 +341,9 @@ static void pointerHandleAxis(void* data, axis == WL_POINTER_AXIS_VERTICAL_SCROLL); if (axis == WL_POINTER_AXIS_HORIZONTAL_SCROLL) - x = wl_fixed_to_double(value) * scrollFactor; + x = -wl_fixed_to_double(value) * scrollFactor; else if (axis == WL_POINTER_AXIS_VERTICAL_SCROLL) - y = wl_fixed_to_double(value) * scrollFactor; + y = -wl_fixed_to_double(value) * scrollFactor; _glfwInputScroll(window, x, y); }