Commit a7e2a9d8 authored by Matthias Clasen's avatar Matthias Clasen

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.
parent cd6ca291
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment