diff options
author | Benjamin Otte <otte@redhat.com> | 2012-10-05 18:45:37 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2012-10-06 15:55:31 -0400 |
commit | 55ade04e115e81851aa4cc9ee038509e60cb7bbc (patch) | |
tree | f7b71066cefb32570bf5094ecfb7229565a3fa43 /gtk/gtkcsstransition.c | |
parent | f9ddfa28b8432854617dec496a537f97cefc66e7 (diff) | |
download | gtk+-55ade04e115e81851aa4cc9ee038509e60cb7bbc.tar.gz |
animations: Don't set animated values for finished transitions
Otherwise, that value will never get reset and remain frozen in time.
This is problematic for example when the value is inherited and the
parent changes the value.
Diffstat (limited to 'gtk/gtkcsstransition.c')
-rw-r--r-- | gtk/gtkcsstransition.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/gtk/gtkcsstransition.c b/gtk/gtkcsstransition.c index bbd2dccae3..08db4285fc 100644 --- a/gtk/gtkcsstransition.c +++ b/gtk/gtkcsstransition.c @@ -38,9 +38,7 @@ gtk_css_transition_set_values (GtkStyleAnimation *animation, if (transition->start_time >= for_time_us) value = _gtk_css_value_ref (transition->start); - else if (transition->end_time <= for_time_us) - value = _gtk_css_value_ref (end); - else + else if (transition->end_time > for_time_us) { progress = (double) (for_time_us - transition->start_time) / (transition->end_time - transition->start_time); progress = _gtk_css_ease_value_transform (transition->ease, progress); @@ -52,9 +50,14 @@ gtk_css_transition_set_values (GtkStyleAnimation *animation, if (value == NULL) value = _gtk_css_value_ref (end); } + else + value = NULL; - _gtk_css_computed_values_set_animated_value (values, transition->property, value); - _gtk_css_value_unref (value); + if (value) + { + _gtk_css_computed_values_set_animated_value (values, transition->property, value); + _gtk_css_value_unref (value); + } } static gboolean |