diff options
author | Benjamin Otte <otte@redhat.com> | 2012-10-01 13:09:49 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2012-10-01 13:09:49 +0200 |
commit | 9138fc11cfc8c1bcf247e0c3f4c931b741e929b7 (patch) | |
tree | e44f30da094cf7d9982194c072df7471081e30c2 | |
parent | a7d213854460a7820d9665650a507081b9d196b7 (diff) | |
download | gtk+-9138fc11cfc8c1bcf247e0c3f4c931b741e929b7.tar.gz |
cssanimation: Don't store the end value in a CSS transition
Instead, query the intrinsic value at runtime.
-rw-r--r-- | gtk/gtkcsscomputedvalues.c | 1 | ||||
-rw-r--r-- | gtk/gtkcsstransition.c | 14 | ||||
-rw-r--r-- | gtk/gtkcsstransitionprivate.h | 2 |
3 files changed, 6 insertions, 11 deletions
diff --git a/gtk/gtkcsscomputedvalues.c b/gtk/gtkcsscomputedvalues.c index 12424cc083..ff89eee881 100644 --- a/gtk/gtkcsscomputedvalues.c +++ b/gtk/gtkcsscomputedvalues.c @@ -412,7 +412,6 @@ gtk_css_computed_values_create_css_transitions (GtkCssComputedValues *values, { animation = _gtk_css_transition_new (i, start, - end, _gtk_css_array_value_get_nth (timing_functions, i), timestamp + delay * G_USEC_PER_SEC, timestamp + (delay + duration) * G_USEC_PER_SEC); diff --git a/gtk/gtkcsstransition.c b/gtk/gtkcsstransition.c index 8aa7737a2f..bbd2dccae3 100644 --- a/gtk/gtkcsstransition.c +++ b/gtk/gtkcsstransition.c @@ -31,24 +31,26 @@ gtk_css_transition_set_values (GtkStyleAnimation *animation, GtkCssComputedValues *values) { GtkCssTransition *transition = GTK_CSS_TRANSITION (animation); - GtkCssValue *value; + GtkCssValue *value, *end; double progress; + end = _gtk_css_computed_values_get_intrinsic_value (values, transition->property); + 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 (transition->end); + value = _gtk_css_value_ref (end); else { progress = (double) (for_time_us - transition->start_time) / (transition->end_time - transition->start_time); progress = _gtk_css_ease_value_transform (transition->ease, progress); value = _gtk_css_value_transition (transition->start, - transition->end, + end, transition->property, progress); if (value == NULL) - value = _gtk_css_value_ref (transition->end); + value = _gtk_css_value_ref (end); } _gtk_css_computed_values_set_animated_value (values, transition->property, value); @@ -79,7 +81,6 @@ gtk_css_transition_finalize (GObject *object) GtkCssTransition *transition = GTK_CSS_TRANSITION (object); _gtk_css_value_unref (transition->start); - _gtk_css_value_unref (transition->end); _gtk_css_value_unref (transition->ease); G_OBJECT_CLASS (_gtk_css_transition_parent_class)->finalize (object); @@ -106,7 +107,6 @@ _gtk_css_transition_init (GtkCssTransition *transition) GtkStyleAnimation * _gtk_css_transition_new (guint property, GtkCssValue *start, - GtkCssValue *end, GtkCssValue *ease, gint64 start_time_us, gint64 end_time_us) @@ -114,7 +114,6 @@ _gtk_css_transition_new (guint property, GtkCssTransition *transition; g_return_val_if_fail (start != NULL, NULL); - g_return_val_if_fail (end != NULL, NULL); g_return_val_if_fail (ease != NULL, NULL); g_return_val_if_fail (start_time_us <= end_time_us, NULL); @@ -122,7 +121,6 @@ _gtk_css_transition_new (guint property, transition->property = property; transition->start = _gtk_css_value_ref (start); - transition->end = _gtk_css_value_ref (end); transition->ease = _gtk_css_value_ref (ease); transition->start_time = start_time_us; transition->end_time = end_time_us; diff --git a/gtk/gtkcsstransitionprivate.h b/gtk/gtkcsstransitionprivate.h index c8af3fce91..2d075b01df 100644 --- a/gtk/gtkcsstransitionprivate.h +++ b/gtk/gtkcsstransitionprivate.h @@ -40,7 +40,6 @@ struct _GtkCssTransition guint property; GtkCssValue *start; - GtkCssValue *end; GtkCssValue *ease; gint64 start_time; gint64 end_time; @@ -55,7 +54,6 @@ GType _gtk_css_transition_get_type (void) G_GNUC_CONST; GtkStyleAnimation * _gtk_css_transition_new (guint property, GtkCssValue *start, - GtkCssValue *end, GtkCssValue *ease, gint64 start_time_us, gint64 end_time_us); |