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:
parent
5d0bcc99fa
commit
07818934b6
|
@ -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) {
|
if (set->surface && color.a > 0 && end_x >= clip.x && start_x < clip_end_x) {
|
||||||
uint8_t* source_pixels = set->surface->pixels;
|
uint8_t* source_pixels = set->surface->pixels;
|
||||||
for (int line = metric->y0; line < metric->y1; ++line) {
|
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)
|
if (target_y < clip.y)
|
||||||
continue;
|
continue;
|
||||||
if (target_y >= clip_end_y)
|
if (target_y >= clip_end_y)
|
||||||
|
|
Loading…
Reference in New Issue