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.
This commit is contained in:
Timm Bäder 2017-12-10 22:27:21 +01:00
parent eb221ff305
commit bed03aa319

View File

@ -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));
}
}