[gtk+/gtk-3-22] Range: Fix inverted horizontal scroll wheel events



commit 91064360037fed243af588807e49e10ab6683dcb
Author: Daniel Boles <dboles src gnome org>
Date:   Sat Oct 14 18:45:20 2017 +0100

    Range: Fix inverted horizontal scroll wheel events
    
    Bug 737175 aimed to ensure that scrolling up on a horizontal range would
    result in its value increasing, as that’s what users intuitively expect.
    However, its commit 416c370da1d2eff2458e4a0c5b8e504cd8061559 meant that,
    if the event gives scroll deltas, we inverted our delta unconditionally.
    
    So it broke horizontal scrolling: scrolling left moved the slider right…
    
    We must only invert if using dy as delta. dx already has the right sign,
    so inverting it was wrong.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=788905

 gtk/gtkrange.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c
index eee45be..7873687 100644
--- a/gtk/gtkrange.c
+++ b/gtk/gtkrange.c
@@ -3053,7 +3053,7 @@ _gtk_range_get_wheel_delta (GtkRange       *range,
 #endif
 
       if (gtk_orientable_get_orientation (GTK_ORIENTABLE (range)) == GTK_ORIENTATION_HORIZONTAL)
-        delta = - (dx ? dx : dy) * scroll_unit;
+        delta = (dx ? dx : -dy) * scroll_unit;
       else
         delta = dy * scroll_unit;
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]