mirror of
				https://github.com/godotengine/godot.git
				synced 2025-10-31 13:41:03 +00:00 
			
		
		
		
	When inserting new values in array property editor, keep type of last item, closes #2391
This commit is contained in:
		
							parent
							
								
									ec3d17b4e2
								
							
						
					
					
						commit
						565513fb89
					
				
					 1 changed files with 9 additions and 0 deletions
				
			
		|  | @ -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)); | 					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_do_method(this,"_notif_change"); | ||||||
| 			ur->add_undo_method(this,"_notif_change"); | 			ur->add_undo_method(this,"_notif_change"); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Juan Linietsky
						Juan Linietsky