From a2b8b51097a8893acadbd20c384a9397d0bf9267 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pa=CC=84vels=20Nadtoc=CC=8Cajevs?= <7645683+bruvzg@users.noreply.github.com> Date: Mon, 25 Nov 2024 09:36:53 +0200 Subject: [PATCH] [RTL] Fix clearing text with `set_text("")`. --- scene/gui/rich_text_label.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index b0886a95d7..d71812e3b3 100644 --- a/scene/gui/rich_text_label.cpp +++ b/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() {