mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-04 07:15:29 -04:00
render: draw_bar: don't assume height == ascent+descent
Instead, draw a bar that is ascent+descent tall, positioned around the baseline such that it starts at the ascent and ends at the descent.
This commit is contained in:
parent
013cf61ffb
commit
6e5688d7da
1 changed files with 4 additions and 2 deletions
6
render.c
6
render.c
|
|
@ -103,10 +103,12 @@ static void
|
||||||
draw_bar(const struct terminal *term, pixman_image_t *pix,
|
draw_bar(const struct terminal *term, pixman_image_t *pix,
|
||||||
const pixman_color_t *color, int x, int y)
|
const pixman_color_t *color, int x, int y)
|
||||||
{
|
{
|
||||||
/* TODO: investigate if this is the best way */
|
int baseline = y + font_baseline(term) - term->fextents.ascent;
|
||||||
pixman_image_fill_rectangles(
|
pixman_image_fill_rectangles(
|
||||||
PIXMAN_OP_SRC, pix, color,
|
PIXMAN_OP_SRC, pix, color,
|
||||||
1, &(pixman_rectangle16_t){x, y, 1, term->cell_height});
|
1, &(pixman_rectangle16_t){
|
||||||
|
x, baseline,
|
||||||
|
1, term->fextents.ascent + term->fextents.descent});
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue