Merge pull request #44971 from nekomatata/fix-string-property-update

Update String property field only when text has changed
This commit is contained in:
Rémi Verschelde 2021-01-06 19:55:38 +01:00 committed by GitHub
commit 8158d17edf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);
}
}
}