alelievr / NodeGraphProcessor

Node graph editor framework focused on data processing using Unity UIElements and C# 4.6
https://github.com/alelievr/NodeGraphProcessor/projects/2
MIT License
2.21k stars 369 forks source link

Node in stack can't be dragged out and are stuck #227

Open enzi opened 11 months ago

enzi commented 11 months ago

Hey! Your repo was a huge help to get me started on implementing a StackNode. Thanks for that. While testing I found a bug.

https://github.com/alelievr/NodeGraphProcessor/blob/bc71d48ba9dfc7e7062779d6d12b9ef269e521b1/Assets/com.alelievr.NodeGraphProcessor/Editor/Views/BaseStackNodeView.cs#L106 is never called. So the nodes are never removed from the stack view list.

I debugged the thing and it turns out that only OnStartDragging is called. Must be new? I don't know. But that's also the fix. To move the remove event to OnStartDragging.

Cheers!

enzi commented 11 months ago

Some more info on this because it's not straight forward to reproduce. The node that is moved out of the stack has to be the last node. DragLeave is only called when a placeholder was created in the stack and then the dragged node is moved out of the stack. Being the last node, the stack shrinks immediately and no placeholder is created.