From 0ecc968c5c7593227d048e8c6020ed1a24ae52c1 Mon Sep 17 00:00:00 2001 From: volzhs Date: Thu, 22 Dec 2016 08:52:57 +0900 Subject: Fix duplicated string on RichTextLabel if starts with '\n' Fix #6212, #3773 --- scene/gui/rich_text_label.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scene/gui') diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index 73a3cda5f3..9283d42c05 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -1179,7 +1179,8 @@ void RichTextLabel::add_text(const String& p_text) { item->line=current_frame->lines.size(); _add_item(item,false); current_frame->lines.resize(current_frame->lines.size()+1); - current_frame->lines[current_frame->lines.size()-1].from=item; + if (item->type!=ITEM_NEWLINE) + current_frame->lines[current_frame->lines.size()-1].from=item; _invalidate_current_line(current_frame); } -- cgit v1.2.3