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
This commit is contained in:
Takase 2023-08-04 02:03:33 +08:00 committed by George Sokianos
parent 5145194f1f
commit 8daf7dc926
1 changed files with 1 additions and 1 deletions

View File

@ -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)