[clutter] interactive/scrolling: Use the implicit animation API



commit 40365a1f183ded88019b5e8995b535bbaa2315a1
Author: Emmanuele Bassi <ebassi linux intel com>
Date:   Wed Mar 21 12:57:26 2012 +0000

    interactive/scrolling: Use the implicit animation API

 tests/interactive/test-scrolling.c |   20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)
---
diff --git a/tests/interactive/test-scrolling.c b/tests/interactive/test-scrolling.c
index 87aed0e..173325f 100644
--- a/tests/interactive/test-scrolling.c
+++ b/tests/interactive/test-scrolling.c
@@ -34,17 +34,19 @@ on_drag_end (ClutterDragAction   *action,
   /* check if we're at the viewport edges */
   if (viewport_x > 0)
     {
-      clutter_actor_animate (viewport, CLUTTER_EASE_OUT_BOUNCE, 250,
-                             "x", 0.0,
-                             NULL);
+      clutter_actor_save_easing_state (viewport);
+      clutter_actor_set_easing_mode (viewport, CLUTTER_EASE_OUT_BOUNCE);
+      clutter_actor_set_x (viewport, 0);
+      clutter_actor_restore_easing_state (viewport);
       return;
     }
 
   if (viewport_x < (-1.0f * (RECT_WIDTH * (N_RECTS - 1))))
     {
-      clutter_actor_animate (viewport, CLUTTER_EASE_OUT_BOUNCE, 250,
-                             "x", (-1.0f * (RECT_WIDTH * (N_RECTS - 1))),
-                             NULL);
+      clutter_actor_save_easing_state (viewport);
+      clutter_actor_set_easing_mode (viewport, CLUTTER_EASE_OUT_BOUNCE);
+      clutter_actor_set_x (viewport, -1.0f * (RECT_WIDTH * (N_RECTS - 1)));
+      clutter_actor_restore_easing_state (viewport);
       return;
     }
 
@@ -60,9 +62,9 @@ on_drag_end (ClutterDragAction   *action,
   /* sanity check on the children number */
   child_visible = CLAMP (child_visible, 0, N_RECTS);
 
-  clutter_actor_animate (viewport, CLUTTER_EASE_OUT_QUAD, 250,
-                         "x", (-1.0f * RECT_WIDTH * child_visible),
-                         NULL);
+  clutter_actor_save_easing_state (viewport);
+  clutter_actor_set_x (viewport, -1.0f * RECT_WIDTH * child_visible);
+  clutter_actor_restore_easing_state (viewport);
 }
 
 G_MODULE_EXPORT int



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