Fixed 0 width issue of rich text label
Fixes #37746
(cherry picked from commit 5e64c146bc
)
This commit is contained in:
parent
8bbcc624fd
commit
a1155b86e4
|
@ -414,7 +414,7 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &
|
||||||
cw = tab_size * font->get_char_size(' ').width;
|
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
|
break; //don't allow lines longer than assigned width
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -442,7 +442,7 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &
|
||||||
end++;
|
end++;
|
||||||
}
|
}
|
||||||
CHECK_HEIGHT(fh);
|
CHECK_HEIGHT(fh);
|
||||||
ENSURE_WIDTH(w);
|
ENSURE_WIDTH(fw);
|
||||||
|
|
||||||
line_ascent = MAX(line_ascent, ascent);
|
line_ascent = MAX(line_ascent, ascent);
|
||||||
line_descent = MAX(line_descent, descent);
|
line_descent = MAX(line_descent, descent);
|
||||||
|
|
Loading…
Reference in New Issue