summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-04-05 10:07:47 +0200
committerGitHub <noreply@github.com>2020-04-05 10:07:47 +0200
commitde1d021574b6f33fb7430f303c360361dd5870bd (patch)
treeeb2168f2f091e1eb5ad196247d71fc8209f410c9 /scene/gui
parent924cecf0b0a90d8cc3c086361d8794f22cc59ef0 (diff)
parent2000e110a9d38ebe889f9d4e6cfb106cbcc58bc8 (diff)
Merge pull request #37397 from Eoin-ONeill-Yokai/Bug37081
Correction to RichTextLabel Tabulation (Bug 37081)
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/rich_text_label.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp
index 5fb2243aff..3ab5e5427d 100644
--- a/scene/gui/rich_text_label.cpp
+++ b/scene/gui/rich_text_label.cpp
@@ -582,13 +582,14 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &
} else {
cw = drawer.draw_char(ci, p_ofs + Point2(align_ofs + pofs, y + lh - line_descent) + fx_offset, fx_char, c[i + 1], fx_color);
}
- } else if (previously_visible) {
+ } else if (previously_visible && c[i] != '\t') {
backtrack += font->get_char_size(fx_char, c[i + 1]).x;
}
p_char_count++;
if (c[i] == '\t') {
cw = tab_size * font->get_char_size(' ').width;
+ backtrack = MAX(0, backtrack - cw);
}
ofs += cw;