summaryrefslogtreecommitdiff
path: root/editor/editor_properties.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-01-06 19:55:38 +0100
committerGitHub <noreply@github.com>2021-01-06 19:55:38 +0100
commit8158d17edf18e3d6ec847d2cb710012361e7b12e (patch)
treed063ca43ef99a6bb487ce5dfc2ccde75231dc209 /editor/editor_properties.cpp
parenta7baf013524ccd271bd123d8aef93a73b450a888 (diff)
parentc064378f954346c0e37252cf785878fe5c7bb633 (diff)
Merge pull request #44971 from nekomatata/fix-string-property-update
Update String property field only when text has changed
Diffstat (limited to 'editor/editor_properties.cpp')
-rw-r--r--editor/editor_properties.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp
index 90c7a4d1e9..143eea88e1 100644
--- a/editor/editor_properties.cpp
+++ b/editor/editor_properties.cpp
@@ -77,7 +77,9 @@ void EditorPropertyText::_text_changed(const String &p_string) {
void EditorPropertyText::update_property() {
String s = get_edited_object()->get(get_edited_property());
updating = true;
- text->set_text(s);
+ if (text->get_text() != s) {
+ text->set_text(s);
+ }
text->set_editable(!is_read_only());
updating = false;
}
@@ -133,9 +135,11 @@ void EditorPropertyMultilineText::_open_big_text() {
void EditorPropertyMultilineText::update_property() {
String t = get_edited_object()->get(get_edited_property());
- text->set_text(t);
- if (big_text && big_text->is_visible_in_tree()) {
- big_text->set_text(t);
+ if (text->get_text() != t) {
+ text->set_text(t);
+ if (big_text && big_text->is_visible_in_tree()) {
+ big_text->set_text(t);
+ }
}
}