[gtk/wip/otte/reftests: 7/14] cssimagelinear: Make gradient offsets stay in [0, 1]
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/otte/reftests: 7/14] cssimagelinear: Make gradient offsets stay in [0, 1]
- Date: Fri, 29 Mar 2019 04:54:16 +0000 (UTC)
commit 13e91d1d20bcf2ef9f81ef3b6323b97c6457785b
Author: Benjamin Otte <otte redhat com>
Date: Fri Mar 29 05:01:33 2019 +0100
cssimagelinear: Make gradient offsets stay in [0, 1]
Fixes linear-gradient reftest
gtk/gtkcssimagelinear.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/gtk/gtkcssimagelinear.c b/gtk/gtkcssimagelinear.c
index 1253ed8bf9..5487767ae2 100644
--- a/gtk/gtkcssimagelinear.c
+++ b/gtk/gtkcssimagelinear.c
@@ -211,7 +211,10 @@ gtk_css_image_linear_snapshot (GtkCssImage *image,
continue;
}
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);
step = (pos - offset) / (i - last);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]