From 2efd1016ce9174cffbfe2c800038a1f141fd712c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Fri, 9 Apr 2021 21:47:57 +0200 Subject: [PATCH] render: draw underline cursor below text underline This ensures the cursor is visible on cells where the text is underlined. Closes #415 --- CHANGELOG.md | 5 +++++ render.c | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a30498b4..496920dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,11 @@ ### Changed + +* Underline cursor is now rendered below text underline + (https://codeberg.org/dnkl/foot/issues/415). + + ### Deprecated ### Removed ### Fixed diff --git a/render.c b/render.c index cee44e54..ddd685b6 100644 --- a/render.c +++ b/render.c @@ -387,9 +387,10 @@ draw_cursor(const struct terminal *term, const struct cell *cell, if (likely(term->cursor_blink.state == CURSOR_BLINK_ON || !term->kbd_focus)) { + struct fcft_font *font = attrs_to_font(term, &cell->attrs); draw_underline( - term, pix, attrs_to_font(term, &cell->attrs), &cursor_color, - x, y, cols); + term, pix, font, &cursor_color, + x, y + font->underline.thickness, cols); } break; }