Skip to content

Commit

Permalink
Merge pull request #77280 from Rindbee/fix-unnecessary-break-in-Label
Browse files Browse the repository at this point in the history
Fix unnecessary break when calculating the height of visible lines
  • Loading branch information
akien-mga committed Aug 2, 2023
2 parents df616c9 + e5bebbc commit b156e24
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions scene/gui/label.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,6 @@ void Label::_update_visible() {
int last_line = MIN(lines_rid.size(), lines_visible + lines_skipped);
for (int64_t i = lines_skipped; i < last_line; i++) {
minsize.height += TS->shaped_text_get_size(lines_rid[i]).y + line_spacing;
if (minsize.height > (get_size().height - style->get_minimum_size().height + line_spacing)) {
break;
}
}
if (minsize.height > 0) {
minsize.height -= line_spacing;
Expand Down

0 comments on commit b156e24

Please sign in to comment.