1
0
Fork 0

Merge pull request #101771 from bruvzg/lbl_line_valign

Fix Label vertical line alignment.
This commit is contained in:
Thaddeus Crews 2025-01-27 09:46:27 -06:00
commit 6dc78c8aa1
No known key found for this signature in database
GPG Key ID: 62181B86FE9E5D84
1 changed files with 3 additions and 1 deletions

View File

@ -713,7 +713,9 @@ void Label::_notification(int p_what) {
int asc = TS->shaped_text_get_ascent(line_rid);
int dsc = TS->shaped_text_get_descent(line_rid);
if (asc + dsc < font_h) {
dsc = font_h - asc;
int diff = font_h - (asc + dsc);
asc += diff / 2;
dsc += diff - (diff / 2);
}
const Glyph *glyphs = TS->shaped_text_get_glyphs(line_rid);