From bed03aa319ab8290f12c38c8226747186ca6dd68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Sun, 10 Dec 2017 22:27:21 +0100 Subject: [PATCH] gl renderer: Fix linear gradient shader color calculation This fixes both the wrong headerbar color and the broken border color in of the circular button in the widget-factory. --- gsk/resources/glsl/linear_gradient.fs.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gsk/resources/glsl/linear_gradient.fs.glsl b/gsk/resources/glsl/linear_gradient.fs.glsl index 2e8450753a..0b1f1cc0c1 100644 --- a/gsk/resources/glsl/linear_gradient.fs.glsl +++ b/gsk/resources/glsl/linear_gradient.fs.glsl @@ -34,7 +34,7 @@ void main() { for (int i = 1; i < u_num_color_stops; i ++) { if (offset >= u_color_offsets[i - 1]) { float o = (offset - u_color_offsets[i - 1]) / (u_color_offsets[i] - u_color_offsets[i - 1]); - color = mix(u_color_stops[i - 1], u_color_stops[i], o); + color = mix(u_color_stops[i - 1], u_color_stops[i], clamp(o, 0.0, 1.0)); } }