diff options
Diffstat (limited to 'editor/editor_properties.cpp')
-rw-r--r-- | editor/editor_properties.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index 155802d16c..899fa69be1 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -90,7 +90,9 @@ void EditorPropertyText::update_property() { String s = get_edited_object()->get(get_edited_property()); updating = true; if (text->get_text() != s) { + int caret = text->get_caret_column(); text->set_text(s); + text->set_caret_column(caret); } text->set_editable(!is_read_only()); updating = false; @@ -760,8 +762,13 @@ void EditorPropertyEnum::_option_selected(int p_which) { } void EditorPropertyEnum::update_property() { - int64_t which = get_edited_object()->get(get_edited_property()); + Variant current = get_edited_object()->get(get_edited_property()); + if (current.get_type() == Variant::NIL) { + options->select(-1); + return; + } + int64_t which = current; for (int i = 0; i < options->get_item_count(); i++) { if (which == (int64_t)options->get_item_metadata(i)) { options->select(i); |