-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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 GraphEdit layering #61783
Fix GraphEdit layering #61783
Conversation
ee5a92f
to
6c8b44c
Compare
The nesting in GraphEdit::_top_layer_input is very deep. will review more. |
This looks good to me, what is it missing? |
Mostly a contributor that feels confident enough with GraphEdit to approve the feature and implementation :) |
I'll take a look. Can it be rebased and ready to merge? |
6c8b44c
to
2368202
Compare
@fire Rebased. |
There's some conflicts. |
2368202
to
1ff9363
Compare
_update_comment_enclosed_nodes_list(gn, comment_enclosed_nodes); | ||
_graph_node_raised(p_gn); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it use the new method?
_set_drag_comment_enclosed_nodes(gn, comment_enclosed_nodes, false); | ||
_reorder_comment_nodes(gn); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit confused by the order of operations. In the below snippet we update enclosed nodes after the reorder, and here we do before. It's a bit hard to follow the logic, so can you tell if this is intentional?
@@ -399,7 +430,18 @@ void GraphEdit::add_child_notify(Node *p_child) { | |||
gn->connect("selected", callable_mp(this, &GraphEdit::_graph_node_selected).bind(gn)); | |||
gn->connect("deselected", callable_mp(this, &GraphEdit::_graph_node_deselected).bind(gn)); | |||
gn->connect("slot_updated", callable_mp(this, &GraphEdit::_graph_node_slot_updated).bind(gn)); | |||
|
|||
if (gn->is_comment()) { | |||
background_nodes_separator_idx++; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we actually need to track this? Can't we update connections layer's index along the comments? And in _graph_node_raised
we can probably just refer to the connection layer's index.
I'm just concerned that adding a tracker like that would make the code too fragile.
Superseded by #67152. |
This PR fixes/improves the ordering of comment nodes as children of GraphEdit as well as the position of the connections layer.
Split from #61414.
Detailed changes:
Before:
This PR: