Skip to content

Commit

Permalink
Merge pull request #103192 from bruvzg/lbl_clip
Browse files Browse the repository at this point in the history
Fix label clipping when ascent/descent are fractional.
  • Loading branch information
akien-mga committed Feb 23, 2025
2 parents 58e4e34 + 33eb772 commit 0e3dbba
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scene/gui/label.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -710,10 +710,10 @@ void Label::_notification(int p_what) {
Vector2 line_offset = _get_line_rect(p, i).position;
ofs.x = line_offset.x;

int asc = TS->shaped_text_get_ascent(line_rid);
int dsc = TS->shaped_text_get_descent(line_rid);
double asc = TS->shaped_text_get_ascent(line_rid);
double dsc = TS->shaped_text_get_descent(line_rid);
if (asc + dsc < font_h) {
int diff = font_h - (asc + dsc);
double diff = font_h - (asc + dsc);
asc += diff / 2;
dsc += diff - (diff / 2);
}
Expand Down

0 comments on commit 0e3dbba

Please # to comment.