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.
This commit is contained in:
Matthias Clasen 2016-01-07 16:10:10 -05:00
parent cd6ca291bd
commit a7e2a9d8d3

View File

@ -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;