Fix #124899: Font bounding box calculation is incorrect for some fonts #125363

Merged
Aras Pranckevicius merged 1 commits from aras_p/blender:blf_fix_bounds into main 2024-07-25 08:45:35 +02:00

View File

@ -901,8 +901,8 @@ static void blf_font_boundbox_ex(FontBLF *font,
}
const ft_pix pen_x_next = pen_x + g->advance_x;
const ft_pix gbox_xmin = pen_x;
const ft_pix gbox_xmax = pen_x_next;
const ft_pix gbox_xmin = std::min(pen_x, pen_x + g->box_xmin);
const ft_pix gbox_xmax = std::max(pen_x_next, pen_x + g->box_xmax);
const ft_pix gbox_ymin = g->box_ymin + pen_y;
const ft_pix gbox_ymax = g->box_ymax + pen_y;