[gtk+/wip/baedert/gl: 95/95] gl renderer: Fix linear gradient shader color calculation



commit 3d98583ec0053c14d469e73006f8d40e9e3cf2f5
Author: Timm Bäder <mail baedert org>
Date:   Sun Dec 10 22:27:21 2017 +0100

    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 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gsk/resources/glsl/linear_gradient.fs.glsl b/gsk/resources/glsl/linear_gradient.fs.glsl
index 2e84507..0b1f1cc 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));
     }
   }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]