From 46e043ed1ed273b2dd8b4a000f6644c8ca1d09f1 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Thu, 19 May 2016 09:59:58 +0200 Subject: Timeline: Crisper selection rectangles This change removes the "mini gradient" between outline and filling. At least in HighDPI, this gives a crisper impression. Change-Id: I15b97393a8650c28dc52a38d4d106adc95ce261c Reviewed-by: Ulf Hermann --- src/libs/timeline/qml/timelineitems.frag | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/libs/timeline/qml/timelineitems.frag b/src/libs/timeline/qml/timelineitems.frag index f1908e43bb..97d79770f6 100644 --- a/src/libs/timeline/qml/timelineitems.frag +++ b/src/libs/timeline/qml/timelineitems.frag @@ -32,16 +32,13 @@ varying lowp vec3 edgeColor; varying lowp vec3 color; varying lowp vec2 barycentric; -lowp vec4 zero = vec4(0.0); void main() { - lowp vec2 d = fwidth(barycentric) * 5.0; - lowp vec4 edge_closeness = smoothstep(zero, vec4(d.x, d.y, d.x, d.y), + lowp vec2 d = fwidth(barycentric) * 4.0; + lowp vec4 edge_closeness = step(vec4(d.x, d.y, d.x, d.y), vec4(barycentric.x, barycentric.y, 1.0 - barycentric.x, 1.0 - barycentric.y)); lowp float total = min(min(edge_closeness[0], edge_closeness[1]), min(edge_closeness[2], edge_closeness[3])); - // square to make lines sharper - total = total > 0.5 ? (1.0 - (1.0 - total) * (1.0 - total) * 2.0) : total * total * 2.0; gl_FragColor.rgb = mix(edgeColor, color, total); gl_FragColor.a = 1.0; } -- cgit v1.2.1