-
-
Notifications
You must be signed in to change notification settings - Fork 21.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix drag-dropping nodes to parent with internal nodes #78816
Fix drag-dropping nodes to parent with internal nodes #78816
Conversation
You did. Search the file for godot/editor/scene_tree_dock.cpp Line 2627 in 4642448
you also need to do get_child_count(false) .
|
Ah, saw that and concluded it's fine... but indeed it could result in finding a |
ed7fbf9
to
94d96ae
Compare
By "they all cause problem" I actually meant all calls in scene tree dock. Deleting nodes, changing node to root or instantiating all have the same bug. |
94d96ae
to
3f6e35b
Compare
Ok, I've restricted some more code to non-internal nodes only. Haven't tested it at all though, just went with find-read-update manner (again, not sure if I've handled everything). 🙃 Alternatively I guess I could maybe add a method like Current combination of how |
Thanks! |
When reparenting nodes (or moving within the same parent) within the SceneTreeDock all indexes were taking into account internal nodes. However,
Node::move_child
does move the child only within the group of nodes the given node belongs to (internal-front / non-internal / internal-back), its parameter is supposed to be such relative index. Hence an absolute index (including internal nodes) shouldn't be passed to it.This PR makes the
SceneTreeDock::_do_reparent
method ensure only non-internal nodes are being moved, and changes all indexes to not take internal nodes into account (hopefully I haven't missed any 🙃; please double check the changes).Fixes #78810 (
TabContainer
has internalTabBar
node).