[clutter/clutter-1.10] actor: Ensure we use the current easing duration and mode
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter/clutter-1.10] actor: Ensure we use the current easing duration and mode
- Date: Wed, 11 Apr 2012 11:53:30 +0000 (UTC)
commit 9283eda3a3c7360059b21b7b7dea9bb4de9231f5
Author: Emmanuele Bassi <ebassi linux intel com>
Date: Wed Mar 28 16:39:30 2012 +0100
actor: Ensure we use the current easing duration and mode
When updating a transition in flight, if the current easing state does
not match the transition's.
clutter/clutter-actor.c | 19 ++++++++++++++++---
1 files changed, 16 insertions(+), 3 deletions(-)
---
diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c
index 27ab01e..bfc71c5 100644
--- a/clutter/clutter-actor.c
+++ b/clutter/clutter-actor.c
@@ -17064,14 +17064,27 @@ _clutter_actor_update_transition (ClutterActor *actor,
/* if we're updating with an easing duration of zero milliseconds,
* we just jump the timeline to the end and let it run its course
*/
- if (info->cur_state == NULL || info->cur_state->easing_duration == 0)
+ if (info->cur_state != NULL &&
+ info->cur_state->easing_duration != 0)
+ {
+ guint cur_duration = clutter_timeline_get_duration (timeline);
+ ClutterAnimationMode cur_mode =
+ clutter_timeline_get_progress_mode (timeline);
+
+ if (cur_duration != info->cur_state->easing_duration)
+ clutter_timeline_set_duration (timeline, info->cur_state->easing_duration);
+
+ if (cur_mode != info->cur_state->easing_mode)
+ clutter_timeline_set_progress_mode (timeline, info->cur_state->easing_mode);
+
+ clutter_timeline_rewind (timeline);
+ }
+ else
{
guint duration = clutter_timeline_get_duration (timeline);
clutter_timeline_advance (timeline, duration);
}
- else
- clutter_timeline_rewind (timeline);
out:
g_value_unset (&initial);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]