Skip to content

Commit 0bd9437

Browse files
committed
[RTL] Fix text around visible_characters boundary being added twice to the buffer.
1 parent 0c51ede commit 0bd9437

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

scene/gui/rich_text_label.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,10 +593,11 @@ float RichTextLabel::_shape_line(ItemFrame *p_frame, int p_line, const Ref<Font>
593593
String second = tx.substr(remaining_characters, -1);
594594
l.text_buf->add_string(first, font, font_size, lang, it->rid);
595595
l.text_buf->add_string(second, font, font_size, lang, it->rid);
596+
} else {
597+
l.text_buf->add_string(tx, font, font_size, lang, it->rid);
596598
}
597599
remaining_characters -= tx.length();
598600

599-
l.text_buf->add_string(tx, font, font_size, lang, it->rid);
600601
txt += tx;
601602
l.char_count += tx.length();
602603
} break;

0 commit comments

Comments
 (0)