aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2023-07-28 13:37:48 +0000
committerDaniel Eklöf <daniel@ekloef.se>2023-07-28 13:37:48 +0000
commite912656682cd6645241fd5ba9ce3c1d1533c03b4 (patch)
tree3dcd88d74776586715293a67c67dac33a7eba828
parentfont baseline: use max(font->height, font->ascent + font->descent) when calculating font height (diff)
render: revert part of a36f67cbe311bebd9321fbf58773dace8128fcd7
render_osd() shouldn't use term_font_baseline(). This is because term_font_baseline() uses the line height to determine the position, while render_osd() renders to surfaces that aren't sized like the grid. This fixes a regression, where the CSD title were sometimes rendered too high up, and sometimes too low.
-rw-r--r--render.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/render.c b/render.c
index 847e57e3..37c0c97d 100644
--- a/render.c
+++ b/render.c
@@ -1926,12 +1926,12 @@ render_osd(struct terminal *term, const struct wayl_sub_surface *sub_surf,
if (pixman_image_get_format(glyph->pix) == PIXMAN_a8r8g8b8) {
pixman_image_composite32(
PIXMAN_OP_OVER, glyph->pix, NULL, buf->pix[0], 0, 0, 0, 0,
- x + x_ofs + glyph->x, y + /*term->font_y_ofs + font->ascent*/ term_font_baseline(term) - glyph->y,
+ x + x_ofs + glyph->x, y + term->font_y_ofs + font->ascent /*term_font_baseline(term)*/ - glyph->y,
glyph->width, glyph->height);
} else {
pixman_image_composite32(
PIXMAN_OP_OVER, src, glyph->pix, buf->pix[0], 0, 0, 0, 0,
- x + x_ofs + glyph->x, y + /*term->font_y_ofs + font->ascent*/ term_font_baseline(term) - glyph->y,
+ x + x_ofs + glyph->x, y + term->font_y_ofs + font->ascent /* term_font_baseline(term)*/ - glyph->y,
glyph->width, glyph->height);
}