From cf81fff062c8cac850f491ac722d6bb79a8bde14 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Thu, 17 Jun 2021 17:52:38 +0200 Subject: config: add underline-offset option This option allows the user to configure a custom underline offset. That is, use the user provided offset instead of the font provided one. Closes #490 --- render.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'render.c') diff --git a/render.c b/render.c index 68ddf5a6..bebb479a 100644 --- a/render.c +++ b/render.c @@ -319,7 +319,11 @@ draw_underline_with_thickness( const pixman_color_t *color, int x, int y, int cols, int thickness) { /* Make sure the line isn't positioned below the cell */ - int y_ofs = font_baseline(term) - font->underline.position; + int y_ofs = font_baseline(term) - + (term->conf->use_custom_underline_offset + ? -term_pt_or_px_as_pixels(term, &term->conf->underline_offset) + : font->underline.position); + y_ofs = min(y_ofs, term->cell_height - thickness); pixman_image_fill_rectangles( -- cgit v1.3