render: draw underline cursor below text underline

This ensures the cursor is visible on cells where the text is
underlined.

Closes #415
This commit is contained in:
Daniel Eklöf 2021-04-09 21:47:57 +02:00
parent 0f792fa1ce
commit 2efd1016ce
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 8 additions and 2 deletions

View file

@ -35,6 +35,11 @@
### Changed
* Underline cursor is now rendered below text underline
(https://codeberg.org/dnkl/foot/issues/415).
### Deprecated
### Removed
### Fixed

View file

@ -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;
}