Ver Fonte

Merge pull request #99665 from bruvzg/rtl_clean

[RTL] Fix clearing text with `set_text("")`.
Rémi Verschelde há 10 meses atrás
pai
commit
e78ad1dfca
1 ficheiros alterados com 5 adições e 1 exclusões
  1. 5 1
      scene/gui/rich_text_label.cpp

+ 5 - 1
scene/gui/rich_text_label.cpp

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