Merge pull request #37840 from Janglee123/richtext-underline-fix-2

Fixed 0 width issue of rich text label
This commit is contained in:
Rémi Verschelde 2020-04-13 13:55:18 +02:00 committed by GitHub
commit 5247fdb3f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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
}
@ -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);