]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkcssbgsizevalue.c
cssanimation: Implement pausing the animation
[~andy/gtk] / gtk / gtkcssbgsizevalue.c
index 2bff385b9f3ade956633afe7f8aa58d080bc3130..e545f61b344e8f81081a1c880bade99d35a1bca1 100644 (file)
@@ -40,19 +40,31 @@ gtk_css_value_bg_size_free (GtkCssValue *value)
   g_slice_free (GtkCssValue, value);
 }
 
-GtkCssValue *
+static GtkCssValue *
 gtk_css_value_bg_size_compute (GtkCssValue        *value,
                                guint               property_id,
                                GtkStyleContext    *context,
                                GtkCssDependencies *dependencies)
 {
+  GtkCssValue *x, *y;
+  GtkCssDependencies x_deps, y_deps;
+
   if (value->x == NULL && value->y == NULL)
     return _gtk_css_value_ref (value);
 
-  *dependencies = GTK_CSS_DEPENDS_ON_EVERYTHING;
+  x_deps = y_deps = 0;
+  x = y = NULL;
+
+  if (value->x)
+    x = _gtk_css_value_compute (value->x, property_id, context, &x_deps);
+
+  if (value->y)
+    y = _gtk_css_value_compute (value->y, property_id, context, &y_deps);
+
+  *dependencies = _gtk_css_dependencies_union (x_deps, y_deps);
 
-  return _gtk_css_bg_size_value_new (value->x ? _gtk_css_value_compute (value->x, property_id, context, NULL) : NULL,
-                                     value->y ? _gtk_css_value_compute (value->y, property_id, context, NULL) : NULL);
+  return _gtk_css_bg_size_value_new (value->x ? x : NULL,
+                                     value->y ? y : NULL);
 }
 
 static gboolean
@@ -72,6 +84,7 @@ gtk_css_value_bg_size_equal (const GtkCssValue *value1,
 static GtkCssValue *
 gtk_css_value_bg_size_transition (GtkCssValue *start,
                                   GtkCssValue *end,
+                                  guint        property_id,
                                   double       progress)
 {
   GtkCssValue *x, *y;
@@ -87,7 +100,7 @@ gtk_css_value_bg_size_transition (GtkCssValue *start,
 
   if (start->x)
     {
-      x = _gtk_css_value_transition (start->x, end->x, progress);
+      x = _gtk_css_value_transition (start->x, end->x, property_id, progress);
       if (x == NULL)
         return NULL;
     }
@@ -96,7 +109,7 @@ gtk_css_value_bg_size_transition (GtkCssValue *start,
 
   if (start->y)
     {
-      y = _gtk_css_value_transition (start->y, end->y, progress);
+      y = _gtk_css_value_transition (start->y, end->y, property_id, progress);
       if (y == NULL)
         {
           _gtk_css_value_unref (x);