From 40365a1f183ded88019b5e8995b535bbaa2315a1 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 21 Mar 2012 12:57:26 +0000 Subject: [PATCH] interactive/scrolling: Use the implicit animation API --- tests/interactive/test-scrolling.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/tests/interactive/test-scrolling.c b/tests/interactive/test-scrolling.c index 87aed0edf..173325fda 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