mirror of
				https://github.com/godotengine/godot.git
				synced 2025-10-31 13:41:03 +00:00 
			
		
		
		
	Mark node groups as dirty for every children if parent is moved
This commit is contained in:
		
							parent
							
								
									d8b0a8cd29
								
							
						
					
					
						commit
						8e5ad7be46
					
				
					 2 changed files with 14 additions and 5 deletions
				
			
		|  | @ -384,11 +384,7 @@ void Node::_move_child(Node *p_child, int p_pos, bool p_ignore_end) { | |||
| 	for (int i = motion_from; i <= motion_to; i++) { | ||||
| 		data.children[i]->notification(NOTIFICATION_MOVED_IN_PARENT); | ||||
| 	} | ||||
| 	for (const KeyValue<StringName, GroupData> &E : p_child->data.grouped) { | ||||
| 		if (E.value.group) { | ||||
| 			E.value.group->changed = true; | ||||
| 		} | ||||
| 	} | ||||
| 	p_child->_propagate_groups_dirty(); | ||||
| 
 | ||||
| 	data.blocked--; | ||||
| } | ||||
|  | @ -408,6 +404,18 @@ void Node::raise() { | |||
| 	} | ||||
| } | ||||
| 
 | ||||
| void Node::_propagate_groups_dirty() { | ||||
| 	for (const KeyValue<StringName, GroupData> &E : data.grouped) { | ||||
| 		if (E.value.group) { | ||||
| 			E.value.group->changed = true; | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	for (int i = 0; i < data.children.size(); i++) { | ||||
| 		data.children[i]->_propagate_groups_dirty(); | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| void Node::add_child_notify(Node *p_child) { | ||||
| 	// to be used when not wanted
 | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Yuri Sizov
						Yuri Sizov