From c35ccaf9b542cc90d3a37f123fe6cb429ad9157c Mon Sep 17 00:00:00 2001 From: Kirill Chibisov Date: Thu, 10 Feb 2022 15:29:03 +0300 Subject: [PATCH] Make undercurls thickness close to underlines Fixes #5873. --- alacritty/res/rect.f.glsl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/alacritty/res/rect.f.glsl b/alacritty/res/rect.f.glsl index 00c2de83..ab1d9dcd 100644 --- a/alacritty/res/rect.f.glsl +++ b/alacritty/res/rect.f.glsl @@ -37,8 +37,9 @@ void main() * cos(float(x) * 2 * PI / float(cellWidth)) + cellHeight - undercurlPosition; - float undercurl_top = undercurl + undercurlThickness / 2.; - float undercurl_bottom = undercurl - undercurlThickness / 2.; + // We subtract one, since curve is already 1px thick. + float undercurl_top = undercurl + max((undercurlThickness - 1), 0); + float undercurl_bottom = undercurl - max((undercurlThickness - 1), 0); // Compute resulted alpha based on distance from `gl_FragCoord.y` to the