From d8113dc2b649f5e5b14fa26a08d13968bfa8c096 Mon Sep 17 00:00:00 2001 From: Kirill Chibisov Date: Wed, 2 Mar 2022 22:35:19 +0300 Subject: Fix gap calculation for dashed underline --- alacritty/res/rect.f.glsl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/alacritty/res/rect.f.glsl b/alacritty/res/rect.f.glsl index 10c7983a..0e0a2616 100644 --- a/alacritty/res/rect.f.glsl +++ b/alacritty/res/rect.f.glsl @@ -98,12 +98,12 @@ color_t draw_dotted(float_t x, float_t y) { color_t draw_dashed(float_t x) { // Since dashes of adjacent cells connect with each other our dash length is // half of the desired total length. - float_t halfDashLen = floor(cellWidth / 4.); + float_t halfDashLen = floor(cellWidth / 4. + 0.5); float_t alpha = 1.; // Check if `x` coordinate is where we should draw gap. - if (x > halfDashLen && x < cellWidth - halfDashLen - 1.) { + if (x > halfDashLen - 1. && x < cellWidth - halfDashLen) { alpha = 0.; } -- cgit