summaryrefslogtreecommitdiff
path: root/tools/editor/array_property_edit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/editor/array_property_edit.cpp')
-rw-r--r--tools/editor/array_property_edit.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/editor/array_property_edit.cpp b/tools/editor/array_property_edit.cpp
index 64a2762095..66c2782da5 100644
--- a/tools/editor/array_property_edit.cpp
+++ b/tools/editor/array_property_edit.cpp
@@ -72,6 +72,15 @@ bool ArrayPropertyEdit::_set(const StringName& p_name, const Variant& p_value){
ur->add_undo_method(this,"_set_value",i,arr.get(i));
}
+ } else if (newsize>size && size) {
+
+ Variant init;
+ Variant::CallError ce;
+ init = Variant::construct(arr.get(size-1).get_type(),NULL,0,ce);
+ for(int i=size;i<newsize;i++) {
+ ur->add_do_method(this,"_set_value",i,init);
+ }
+
}
ur->add_do_method(this,"_notif_change");
ur->add_undo_method(this,"_notif_change");
@@ -83,6 +92,7 @@ bool ArrayPropertyEdit::_set(const StringName& p_name, const Variant& p_value){
_change_notify();
return true;
}
+
} else if (pn.begins_with("indices")) {
if (pn.find("_")!=-1) {