浏览代码

[RTL] Fix clearing text with `set_text("")`.

Pāvels Nadtočajevs 11 月之前
父节点
当前提交
a2b8b51097
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      scene/gui/rich_text_label.cpp

+ 5 - 1
scene/gui/rich_text_label.cpp

@@ -5828,7 +5828,11 @@ void RichTextLabel::set_text(const String &p_bbcode) {
 	stack_externally_modified = false;
 
 	text = p_bbcode;
-	_apply_translation();
+	if (text.is_empty()) {
+		clear();
+	} else {
+		_apply_translation();
+	}
 }
 
 void RichTextLabel::_apply_translation() {