radial gradients: Allow 0 start/end values

This commit is contained in:
Timm Bäder 2020-09-16 05:02:07 +02:00
parent 6a089816fc
commit dbfc172f6a
2 changed files with 5 additions and 5 deletions

View File

@ -509,8 +509,8 @@ gsk_radial_gradient_node_new (const graphene_rect_t *bounds,
g_return_val_if_fail (center != NULL, NULL); g_return_val_if_fail (center != NULL, NULL);
g_return_val_if_fail (hradius > 0., NULL); g_return_val_if_fail (hradius > 0., NULL);
g_return_val_if_fail (vradius > 0., NULL); g_return_val_if_fail (vradius > 0., NULL);
g_return_val_if_fail (start > 0., NULL); g_return_val_if_fail (start >= 0., NULL);
g_return_val_if_fail (end > 0., NULL); g_return_val_if_fail (end >= 0., NULL);
g_return_val_if_fail (color_stops != NULL, NULL); g_return_val_if_fail (color_stops != NULL, NULL);
g_return_val_if_fail (n_color_stops >= 2, NULL); g_return_val_if_fail (n_color_stops >= 2, NULL);
g_return_val_if_fail (color_stops[0].offset >= 0, NULL); g_return_val_if_fail (color_stops[0].offset >= 0, NULL);
@ -554,8 +554,8 @@ gsk_repeating_radial_gradient_node_new (const graphene_rect_t *bounds,
g_return_val_if_fail (center != NULL, NULL); g_return_val_if_fail (center != NULL, NULL);
g_return_val_if_fail (hradius > 0., NULL); g_return_val_if_fail (hradius > 0., NULL);
g_return_val_if_fail (vradius > 0., NULL); g_return_val_if_fail (vradius > 0., NULL);
g_return_val_if_fail (start > 0., NULL); g_return_val_if_fail (start >= 0., NULL);
g_return_val_if_fail (end > 0., NULL); g_return_val_if_fail (end >= 0., NULL);
g_return_val_if_fail (color_stops != NULL, NULL); g_return_val_if_fail (color_stops != NULL, NULL);
g_return_val_if_fail (n_color_stops >= 2, NULL); g_return_val_if_fail (n_color_stops >= 2, NULL);
g_return_val_if_fail (color_stops[0].offset >= 0, NULL); g_return_val_if_fail (color_stops[0].offset >= 0, NULL);

View File

@ -1020,7 +1020,7 @@ parse_radial_gradient_node_internal (GtkCssParser *parser,
graphene_point_t center = GRAPHENE_POINT_INIT (25, 25); graphene_point_t center = GRAPHENE_POINT_INIT (25, 25);
double hradius = 25.0; double hradius = 25.0;
double vradius = 25.0; double vradius = 25.0;
double start = 0.5; double start = 0;
double end = 1.0; double end = 1.0;
GArray *stops = NULL; GArray *stops = NULL;
const Declaration declarations[] = { const Declaration declarations[] = {