summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHein-Pieter van Braam <hp@tmm.cx>2018-03-03 01:19:41 +0100
committerGitHub <noreply@github.com>2018-03-03 01:19:41 +0100
commit04345d2557d13e3b219881aeab3f643e9a1ace09 (patch)
tree3e898ad2331a68fc119e5d6d7bf39f0184b23143
parent741af0652dd3e5992654ef401f04f9f461e1d0c5 (diff)
parent0e1e95c41f02acd5ed5c347ff63d0e38185525ad (diff)
Merge pull request #17192 from poke1024/fixrtl-multiline
Fix more regressions in RichTextLabel from PR 15711
-rw-r--r--scene/gui/rich_text_label.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp
index a92c3c326d..5bc5d8e690 100644
--- a/scene/gui/rich_text_label.cpp
+++ b/scene/gui/rich_text_label.cpp
@@ -247,6 +247,7 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &
int rchar = 0;
int lh = 0;
bool line_is_blank = true;
+ int fh = 0;
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 *cf = c;
- int fh = font->get_height();
int ascent = font->get_ascent();
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;
bool underline = false;
@@ -317,12 +313,12 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &
end++;
}
+ CHECK_HEIGHT(fh);
ENSURE_WIDTH(w);
- if (p_mode == PROCESS_CACHE) {
- line_ascent = ascent;
- line_descent = descent;
- }
+ line_ascent = MAX(line_ascent, ascent);
+ line_descent = MAX(line_descent, descent);
+ fh = line_ascent + line_descent;
if (end && c[end - 1] == ' ') {
if (p_mode == PROCESS_CACHE) {