From 019e6efeda8afa90c131014ac1eee4bbadcbb6f4 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 27 Nov 2018 07:19:30 +0530 Subject: [PATCH] Reduce overlap with text when rendering wavy underline at small font sizes --- kitty/fonts/render.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kitty/fonts/render.py b/kitty/fonts/render.py index d5e33a8b2..d2243555f 100644 --- a/kitty/fonts/render.py +++ b/kitty/fonts/render.py @@ -130,6 +130,11 @@ def add_curl(buf, cell_width, position, thickness, cell_height): 255, buf[idx] + int(255 * (1 - distance)) ) + # Ensure all space at bottom of cell is used + min_y = clamp_y(ceil(position + yfactor)) + if min_y < cell_height - 1: + position += cell_height - 1 - min_y + for x_exact in range(cell_width): y_exact = yfactor * cos(x_exact * xfactor) + position y = clamp_y(ceil(y_exact))