summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-04-13 13:55:18 +0200
committerGitHub <noreply@github.com>2020-04-13 13:55:18 +0200
commit5247fdb3f386cdd3de8ab2c27f1d4332905df4eb (patch)
treeffa08f2bab501112e019d0b4a5dae9c338d36e6d /scene
parent644bc87240dd77044fddbd018916ea8e06ead4e4 (diff)
parent5e64c146bc0bbc6896d4ae6dc54545c2c6413a90 (diff)
Merge pull request #37840 from Janglee123/richtext-underline-fix-2
Fixed 0 width issue of rich text label
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/rich_text_label.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp
index 0b314d57c5..9fab9005f9 100644
--- a/scene/gui/rich_text_label.cpp
+++ b/scene/gui/rich_text_label.cpp
@@ -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);