[buoh] Fix zooming with smooth scrolling



commit 09a6ffe0f021088b71d2d3dd38710779126e059c
Author: Jan Tojnar <jtojnar gmail com>
Date:   Sat Feb 2 23:41:57 2019 +0100

    Fix zooming with smooth scrolling

 src/buoh-view-comic.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
---
diff --git a/src/buoh-view-comic.c b/src/buoh-view-comic.c
index 6694878..c7aa1f4 100644
--- a/src/buoh-view-comic.c
+++ b/src/buoh-view-comic.c
@@ -340,6 +340,18 @@ buoh_view_comic_scroll_event (GtkWidget *widget, GdkEventScroll *event)
                 case GDK_SCROLL_RIGHT:
                         buoh_view_comic_zoom_out (c_view);
                         break;
+                case GDK_SCROLL_SMOOTH:
+                {
+                        gdouble delta_x = 0;
+                        gdouble delta_y = 0;
+                        gdk_event_get_scroll_deltas ((GdkEvent *) event, &delta_x, &delta_y);
+                        if (delta_y < 0) {
+                                buoh_view_comic_zoom_in (c_view);
+                        } else if (delta_y > 0) {
+                                buoh_view_comic_zoom_out (c_view);
+                        }
+                        break;
+                }
                 }
 
                 return TRUE;


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