From f7b53e6004d925568efb673df1868f9cb33b48f2 Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Mon, 14 Apr 2008 11:07:34 +0000 Subject: [PATCH] Bug #853 * clutter/clutter-timeline.c (clutter_timeline_get_progressx): Fix arithmetic for calculating the reverse progress when the timeline is backward. (Should subtract from one instead of taking the reciprocal). --- ChangeLog | 9 +++++++++ clutter/clutter-timeline.c | 14 ++++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index a308dd3b7..bc17d65ae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-04-14 Neil Roberts + + Bug #853 + + * clutter/clutter-timeline.c (clutter_timeline_get_progressx): Fix + arithmetic for calculating the reverse progress when the timeline + is backward. (Should subtract from one instead of taking the + reciprocal). + 2008-04-13 Neil Roberts Upgraded the Win32 backend to work with the multi-stage diff --git a/clutter/clutter-timeline.c b/clutter/clutter-timeline.c index b07aebee5..44dc2b955 100644 --- a/clutter/clutter-timeline.c +++ b/clutter/clutter-timeline.c @@ -1304,17 +1304,19 @@ ClutterFixed clutter_timeline_get_progressx (ClutterTimeline *timeline) { ClutterTimelinePrivate *priv; + ClutterFixed progress; g_return_val_if_fail (CLUTTER_IS_TIMELINE (timeline), 0); priv = timeline->priv; - if (priv->direction == CLUTTER_TIMELINE_FORWARD) - return CLUTTER_FIXED_DIV (CLUTTER_INT_TO_FIXED (priv->current_frame_num), - CLUTTER_INT_TO_FIXED (priv->n_frames)); - else - return CLUTTER_FIXED_DIV (CLUTTER_INT_TO_FIXED (priv->n_frames), - CLUTTER_INT_TO_FIXED (priv->current_frame_num)); + progress = CLUTTER_FIXED_DIV (CLUTTER_INT_TO_FIXED (priv->current_frame_num), + CLUTTER_INT_TO_FIXED (priv->n_frames)); + + if (priv->direction == CLUTTER_TIMELINE_BACKWARD) + progress = CFX_ONE - progress; + + return progress; } /**