From a867beffdd6ce45f7452af28f6c60a940ab8ef25 Mon Sep 17 00:00:00 2001 From: Takase <20792268+takase1121@users.noreply.github.com> Date: Fri, 4 Aug 2023 02:03:33 +0800 Subject: [PATCH] feat(src/renderer): unify fontgroup baseline (#1560) * feat(src/renderer): unify fontgroup baseline * fix(src/renderer): use the first font's baseline for the text run --- src/renderer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer.c b/src/renderer.c index d08565ea..f4dbcc78 100644 --- a/src/renderer.c +++ b/src/renderer.c @@ -397,7 +397,7 @@ double ren_draw_text(RenSurface *rs, RenFont **fonts, const char *text, size_t l if (set->surface && color.a > 0 && end_x >= clip.x && start_x < clip_end_x) { uint8_t* source_pixels = set->surface->pixels; for (int line = metric->y0; line < metric->y1; ++line) { - int target_y = line + y - metric->bitmap_top + font->baseline * surface_scale; + int target_y = line + y - metric->bitmap_top + fonts[0]->baseline * surface_scale; if (target_y < clip.y) continue; if (target_y >= clip_end_y)