[clutter] docs: Handle smooth scrolling in cookbook example



commit 61f4dc4bc9b766ef443cb82259f66ccccaff419f
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Mon Jun 18 02:00:28 2018 +0100

    docs: Handle smooth scrolling in cookbook example
    
    We're missing the CLUTTER_SCROLL_SMOOTH case in the switch over the
    scroll direction, and the compiler complains about it.

 doc/cookbook/examples/events-mouse-scroll.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
---
diff --git a/doc/cookbook/examples/events-mouse-scroll.c b/doc/cookbook/examples/events-mouse-scroll.c
index 1b2c8386b..96aa765a6 100644
--- a/doc/cookbook/examples/events-mouse-scroll.c
+++ b/doc/cookbook/examples/events-mouse-scroll.c
@@ -33,6 +33,16 @@ _scroll_event_cb (ClutterActor *viewport,
       y += SCROLL_AMOUNT;
       break;
 
+    case CLUTTER_SCROLL_SMOOTH:
+      {
+        double d_x, d_y;
+
+        clutter_event_get_scroll_delta (event, &d_x, &d_y);
+
+        y += d_y;
+      }
+      break;
+
     /* we're only interested in up and down */
     case CLUTTER_SCROLL_LEFT:
     case CLUTTER_SCROLL_RIGHT:


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