Skip to content

armgit / godot

Public Imported from GitHub
0

Godot Engine – Multi-platform 2D and 3D game engine

[RTL] Do not add zero-width space to last line without content.

Pāvels Nadtočajevs07f3a3f8550d
diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp
index f5f8c7f218d..3624490a2e4 100644
--- a/scene/gui/rich_text_label.cpp
+++ b/scene/gui/rich_text_label.cpp
@@ -715,7 +715,7 @@ float RichTextLabel::_shape_line(ItemFrame *p_frame, int p_line, const Ref<Font>
String txt;
String txt_sub;
Item *it_to = (p_line + 1 < (int)p_frame->lines.size()) ? p_frame->lines[p_line + 1].from : nullptr;
- Item *it_prev = l.from ? l.from : current;
+ Item *it_prev = l.from;
int remaining_characters = visible_characters - l.char_offset;
for (Item *it = l.from; it && it != it_to; it = _get_next_item(it)) {
it_prev = it;