Skip to content

Commit

Permalink
Merge pull request #37840 from Janglee123/richtext-underline-fix-2
Browse files Browse the repository at this point in the history
Fixed 0 width issue of rich text label
  • Loading branch information
akien-mga authored Apr 13, 2020
2 parents 644bc87 + 5e64c14 commit 5247fdb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scene/gui/rich_text_label.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &
cw = tab_size * font->get_char_size(' ').width;
}

if (end > 0 && w + cw + begin > p_width) {
if (end > 0 && fw + cw + begin > p_width) {
break; //don't allow lines longer than assigned width
}

Expand All @@ -416,7 +416,7 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &
end++;
}
CHECK_HEIGHT(fh);
ENSURE_WIDTH(w);
ENSURE_WIDTH(fw);

line_ascent = MAX(line_ascent, ascent);
line_descent = MAX(line_descent, descent);
Expand Down

0 comments on commit 5247fdb

Please sign in to comment.