From e912656682cd6645241fd5ba9ce3c1d1533c03b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Fri, 28 Jul 2023 15:37:48 +0200 Subject: [PATCH] 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. --- render.c | 4 ++-- 1 file 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); }