From 6ef904a960395c7cc81f60febb3d385d9aea4920 Mon Sep 17 00:00:00 2001 From: Will McKinnon Date: Fri, 11 Nov 2022 21:28:32 -0500 Subject: [PATCH] style: shader style fixes --- sway/desktop/shaders/corner.frag | 2 +- sway/desktop/shaders/quad_round_tl.frag | 2 +- sway/desktop/shaders/quad_round_tr.frag | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sway/desktop/shaders/corner.frag b/sway/desktop/shaders/corner.frag index 9c5f0981..7699299a 100644 --- a/sway/desktop/shaders/corner.frag +++ b/sway/desktop/shaders/corner.frag @@ -20,7 +20,7 @@ void main() { vec2 center = gl_FragCoord.xy - position - half_size; float distance = roundedBoxSDF(center, half_size - half_thickness, radius + half_thickness); float smoothedAlphaOuter = 1.0 - smoothstep(-1.0, 1.0, distance - half_thickness); -// Create an inner circle that isn't as anti-aliased as the outer ring + // Create an inner circle that isn't as anti-aliased as the outer ring float smoothedAlphaInner = 1.0 - smoothstep(-1.0, 0.5, distance + half_thickness); gl_FragColor = mix(vec4(0), v_color, smoothedAlphaOuter - smoothedAlphaInner); diff --git a/sway/desktop/shaders/quad_round_tl.frag b/sway/desktop/shaders/quad_round_tl.frag index 6fd0119c..758fece9 100644 --- a/sway/desktop/shaders/quad_round_tl.frag +++ b/sway/desktop/shaders/quad_round_tl.frag @@ -8,7 +8,7 @@ uniform float radius; void main() { vec2 q = abs(gl_FragCoord.xy - position - size) - size + radius; - float distance = min(max(q.x,q.y),0.0) + length(max(q,0.0)) - radius; + float distance = min(max(q.x,q.y),0.0) + length(max(q,0.0)) - radius; float smoothedAlpha = 1.0 - smoothstep(-1.0, 0.5, distance); gl_FragColor = mix(vec4(0), v_color, smoothedAlpha); } diff --git a/sway/desktop/shaders/quad_round_tr.frag b/sway/desktop/shaders/quad_round_tr.frag index ff580045..1d8e879f 100644 --- a/sway/desktop/shaders/quad_round_tr.frag +++ b/sway/desktop/shaders/quad_round_tr.frag @@ -8,7 +8,7 @@ uniform float radius; void main() { vec2 q = abs(gl_FragCoord.xy - position - vec2(0, size.y)) - size + radius; - float distance = min(max(q.x,q.y),0.0) + length(max(q,0.0)) - radius; + float distance = min(max(q.x,q.y),0.0) + length(max(q,0.0)) - radius; float smoothedAlpha = 1.0 - smoothstep(-1.0, 0.5, distance); gl_FragColor = mix(vec4(0), v_color, smoothedAlpha); }