godot
godot copied to clipboard
Fix GraphEdit layering
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:
- the order of comment nodes is now calculated similar to a 2D BVH: when a comment node encloses other comment nodes, the index of the enclosing node is kept below
- the order is updated when resizing a comment node
- the connections layer is now kept between the comment nodes and the normal graph (due to technical limitations it is no longer an internal node)
Before:

This PR:

The nesting in GraphEdit::_top_layer_input is very deep. will review more.
This looks good to me, what is it missing?
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?
@fire Rebased. Just for reference: For now(4.0) I think this will do, but since it is a bit hacky I would like to refactor the current GraphNode/GraphEdit system including the restructuring(#61414) and implementation of layers (or something similar) in the next few months after I opened a proper proposal. A problem might be compatibility breakage so that needs to be discussed.
There's some conflicts.
So, from some quick testing this doesn't seem to work completely as expected. For a new shader the comments are still in front of the connections:

But closing and reopening the file fixes it, even for the nodes added afterwards:

Am I doing something wrong?
Superseded by #67152.