Skip to content

Commit d98528c

Browse files
committed
Fix Label vertical line alignment.
1 parent 7b1ed52 commit d98528c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

scene/gui/label.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,9 @@ void Label::_notification(int p_what) {
713713
int asc = TS->shaped_text_get_ascent(line_rid);
714714
int dsc = TS->shaped_text_get_descent(line_rid);
715715
if (asc + dsc < font_h) {
716-
dsc = font_h - asc;
716+
int diff = font_h - (asc + dsc);
717+
asc += diff / 2;
718+
dsc += diff - (diff / 2);
717719
}
718720

719721
const Glyph *glyphs = TS->shaped_text_get_glyphs(line_rid);

0 commit comments

Comments
 (0)