mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-17 22:05:22 -05:00
render: force underlines to be visible
In some cases, the underline position (typically provided by the font, mind you), end up below the cell, making it visible. Note that below the cell here means below the line. I.e. the font provided underline position is below the font provided line height... Oh well. Doing this in foot rather than fcft, since other applications typically don’t have to clip the rendered text. Closes #503
This commit is contained in:
parent
9b5330bf29
commit
2ac8509c82
2 changed files with 10 additions and 2 deletions
7
render.c
7
render.c
|
|
@ -317,11 +317,14 @@ draw_underline(const struct terminal *term, pixman_image_t *pix,
|
|||
const struct fcft_font *font,
|
||||
const pixman_color_t *color, int x, int y, int cols)
|
||||
{
|
||||
/* Make sure the line isn't positioned below the cell */
|
||||
int y_ofs = font_baseline(term) - font->underline.position;
|
||||
y_ofs = min(y_ofs, term->cell_height - font->underline.thickness);
|
||||
|
||||
pixman_image_fill_rectangles(
|
||||
PIXMAN_OP_SRC, pix, color,
|
||||
1, &(pixman_rectangle16_t){
|
||||
x, y + font_baseline(term) - font->underline.position,
|
||||
cols * term->cell_width, font->underline.thickness});
|
||||
x, y + y_ofs, cols * term->cell_width, font->underline.thickness});
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue