aboutsummaryrefslogtreecommitdiff
path: root/render.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-06-17 15:52:38 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-06-17 15:54:21 +0000
commitcf81fff062c8cac850f491ac722d6bb79a8bde14 (patch)
treefc0e48563073f2eaf4eeec9a4f5c602d76eb39f4 /render.c
parentsearch: don’t crash when we don’t have any XKB compose state (diff)
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
Diffstat (limited to 'render.c')
-rw-r--r--render.c6
1 files changed, 5 insertions, 1 deletions
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(