Fix more regressions in RichTextLabel from PR 15711
(cherry picked from commit 0e1e95c41f
)
This commit is contained in:
parent
4132f2ea7e
commit
f967334f53
|
@ -247,6 +247,7 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &
|
||||||
int rchar = 0;
|
int rchar = 0;
|
||||||
int lh = 0;
|
int lh = 0;
|
||||||
bool line_is_blank = true;
|
bool line_is_blank = true;
|
||||||
|
int fh = 0;
|
||||||
|
|
||||||
while (it) {
|
while (it) {
|
||||||
|
|
||||||
|
@ -262,14 +263,9 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &
|
||||||
|
|
||||||
const CharType *c = text->text.c_str();
|
const CharType *c = text->text.c_str();
|
||||||
const CharType *cf = c;
|
const CharType *cf = c;
|
||||||
int fh = font->get_height();
|
|
||||||
int ascent = font->get_ascent();
|
int ascent = font->get_ascent();
|
||||||
int descent = font->get_descent();
|
int descent = font->get_descent();
|
||||||
|
|
||||||
line_ascent = MAX(line_ascent, ascent);
|
|
||||||
line_descent = MAX(line_descent, descent);
|
|
||||||
fh = MAX(fh, line_ascent + line_descent); // various fonts!
|
|
||||||
|
|
||||||
Color color;
|
Color color;
|
||||||
bool underline = false;
|
bool underline = false;
|
||||||
|
|
||||||
|
@ -317,12 +313,12 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &
|
||||||
end++;
|
end++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CHECK_HEIGHT(fh);
|
||||||
ENSURE_WIDTH(w);
|
ENSURE_WIDTH(w);
|
||||||
|
|
||||||
if (p_mode == PROCESS_CACHE) {
|
line_ascent = MAX(line_ascent, ascent);
|
||||||
line_ascent = ascent;
|
line_descent = MAX(line_descent, descent);
|
||||||
line_descent = descent;
|
fh = line_ascent + line_descent;
|
||||||
}
|
|
||||||
|
|
||||||
if (end && c[end - 1] == ' ') {
|
if (end && c[end - 1] == ' ') {
|
||||||
if (p_mode == PROCESS_CACHE) {
|
if (p_mode == PROCESS_CACHE) {
|
||||||
|
|
Loading…
Reference in New Issue