Skip to content

Commit 0e3dbba

Browse files
committed
Merge pull request #103192 from bruvzg/lbl_clip
Fix label clipping when ascent/descent are fractional.
2 parents 58e4e34 + 33eb772 commit 0e3dbba

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scene/gui/label.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -710,10 +710,10 @@ void Label::_notification(int p_what) {
710710
Vector2 line_offset = _get_line_rect(p, i).position;
711711
ofs.x = line_offset.x;
712712

713-
int asc = TS->shaped_text_get_ascent(line_rid);
714-
int dsc = TS->shaped_text_get_descent(line_rid);
713+
double asc = TS->shaped_text_get_ascent(line_rid);
714+
double dsc = TS->shaped_text_get_descent(line_rid);
715715
if (asc + dsc < font_h) {
716-
int diff = font_h - (asc + dsc);
716+
double diff = font_h - (asc + dsc);
717717
asc += diff / 2;
718718
dsc += diff - (diff / 2);
719719
}

0 commit comments

Comments
 (0)