[gtk+/wip/cssnode3: 65/81] cssstyle: Handle 0 timestamp to mean "don't animate"



commit 888b37d2f40894f0d5aa6b9df11145092957b855
Author: Benjamin Otte <otte redhat com>
Date:   Sat Feb 21 00:15:04 2015 +0100

    cssstyle: Handle 0 timestamp to mean "don't animate"

 gtk/gtkcssanimatedstyle.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkcssanimatedstyle.c b/gtk/gtkcssanimatedstyle.c
index 4583d8c..6e845f6 100644
--- a/gtk/gtkcssanimatedstyle.c
+++ b/gtk/gtkcssanimatedstyle.c
@@ -410,6 +410,9 @@ gtk_css_animated_style_new (GtkCssStyle             *base_style,
   gtk_internal_return_val_if_fail (GTK_IS_STYLE_PROVIDER (provider), NULL);
   gtk_internal_return_val_if_fail (previous_style == NULL || GTK_IS_CSS_STYLE (previous_style), NULL);
 
+  if (timestamp == 0)
+    return g_object_ref (base_style);
+
   animations = NULL;
 
   if (previous_style != NULL)
@@ -441,6 +444,9 @@ gtk_css_animated_style_new_advance (GtkCssAnimatedStyle *source,
   gtk_internal_return_val_if_fail (GTK_IS_CSS_ANIMATED_STYLE (source), NULL);
   gtk_internal_return_val_if_fail (GTK_IS_CSS_STYLE (base), NULL);
   
+  if (timestamp == 0)
+    return g_object_ref (source->style);
+
   animations = NULL;
   for (l = source->animations; l; l = l->next)
     {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]