summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2022-03-16 00:07:32 +0100
committerGitHub <noreply@github.com>2022-03-16 00:07:32 +0100
commit8e72be941c1db849beeb03e180978af11baa1ca2 (patch)
tree4023ac1a26473e8bea69e0a3e443badf9819e156 /scene/gui
parent1de66f135748cc2c809b8d4529571e75ba90eb7e (diff)
parentf789c1769095ca48384fd92519fad99583eb7b40 (diff)
Merge pull request #59165 from Rindbee/fix-text-buf-does-not-clear
Fix text buf does not clear when calling the method set_item_text in …
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/popup_menu.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp
index 4220066b20..9fc1fb072c 100644
--- a/scene/gui/popup_menu.cpp
+++ b/scene/gui/popup_menu.cpp
@@ -1003,8 +1003,12 @@ void PopupMenu::set_item_text(int p_idx, const String &p_text) {
p_idx += get_item_count();
}
ERR_FAIL_INDEX(p_idx, items.size());
+ if (items[p_idx].text == p_text) {
+ return;
+ }
items.write[p_idx].text = p_text;
items.write[p_idx].xl_text = atr(p_text);
+ items.write[p_idx].dirty = true;
_shape_item(p_idx);
control->update();