diff options
author | Juan Linietsky <reduzio@gmail.com> | 2016-07-10 13:07:04 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-10 13:07:04 -0300 |
commit | 7af77e1b7b60a023508ad1b4589b58adc500ddb0 (patch) | |
tree | 3a90d2aea7237a1e07cc50a9fb940a0ba1bec282 /scene | |
parent | 06eef730c0f220ae16fade6e69ed9b81edbb0c23 (diff) | |
parent | 3816fe9d190817b871de3a5b15adee1301b9d267 (diff) |
Merge pull request #5606 from akien-mga/pr-rtl-raw-text
RichTextLabel: Fix adding raw text when bbcode is disabled
Diffstat (limited to 'scene')
-rw-r--r-- | scene/gui/rich_text_label.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index 3a9ed4c6c3..b4fa463cde 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -662,8 +662,7 @@ void RichTextLabel::_notification(int p_what) { } break; case NOTIFICATION_ENTER_TREE: { - if (use_bbcode) - parse_bbcode(bbcode); + set_bbcode(bbcode); main->first_invalid_line=0; //invalidate ALL update(); @@ -1440,7 +1439,6 @@ bool RichTextLabel::is_scroll_following() const { Error RichTextLabel::parse_bbcode(const String& p_bbcode) { - clear(); return append_bbcode(p_bbcode); } @@ -1858,6 +1856,10 @@ void RichTextLabel::set_bbcode(const String& p_bbcode) { bbcode=p_bbcode; if (is_inside_tree() && use_bbcode) parse_bbcode(p_bbcode); + else { // raw text + clear(); + add_text(p_bbcode); + } } String RichTextLabel::get_bbcode() const { @@ -1869,8 +1871,7 @@ void RichTextLabel::set_use_bbcode(bool p_enable) { if (use_bbcode==p_enable) return; use_bbcode=p_enable; - if (is_inside_tree() && use_bbcode) - parse_bbcode(bbcode); + set_bbcode(bbcode); } bool RichTextLabel::is_using_bbcode() const { |