[gtk+] Don't interpolate between keywords



commit a7e2a9d8d3268c851aa1c22da2cbf22ab380e12e
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Jan 7 16:10:10 2016 -0500

    Don't interpolate between keywords
    
    Transitioning between linear gradients like
    linear-gradient(to top, yellow, green) and
    linear-gradient(to left, yellow, green) was yielding
    nonsensical results, with the gradient line jumping around
    wildly. Fix this by falling back to stupid image interpolation
    for these cases.

 gtk/gtkcssimagelinear.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkcssimagelinear.c b/gtk/gtkcssimagelinear.c
index 093a308..492d04a 100644
--- a/gtk/gtkcssimagelinear.c
+++ b/gtk/gtkcssimagelinear.c
@@ -492,6 +492,10 @@ gtk_css_image_linear_transition (GtkCssImage *start_image,
   result = g_object_new (GTK_TYPE_CSS_IMAGE_LINEAR, NULL);
   result->repeating = start->repeating;
 
+  if (_gtk_css_number_value_get_unit (start->angle) == GTK_CSS_NUMBER ||
+      _gtk_css_number_value_get_unit (end->angle) == GTK_CSS_NUMBER)
+    goto fail;
+
   result->angle = _gtk_css_value_transition (start->angle, end->angle, property_id, progress);
   if (result->angle == NULL)
     goto fail;


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