mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-02 17:00:19 +00:00
cssimagelinear: Make gradient offsets stay in [0, 1]
Fixes linear-gradient reftest
This commit is contained in:
parent
fee8f6b9be
commit
b21882bcea
@ -211,7 +211,10 @@ gtk_css_image_linear_snapshot (GtkCssImage *image,
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
pos = _gtk_css_number_value_get (stop->offset, length) / length;
|
{
|
||||||
|
pos = _gtk_css_number_value_get (stop->offset, length) / length;
|
||||||
|
pos = CLAMP (pos, 0.0, 1.0);
|
||||||
|
}
|
||||||
|
|
||||||
pos = MAX (pos, offset);
|
pos = MAX (pos, offset);
|
||||||
step = (pos - offset) / (i - last);
|
step = (pos - offset) / (i - last);
|
||||||
|
Loading…
Reference in New Issue
Block a user