miroiu / nodify

Highly performant and modular controls for node-based editors designed for data-binding and MVVM.
https://miroiu.github.io/nodify
MIT License
1.38k stars 224 forks source link

Add CuttingLine control to Nodify #127

Closed miroiu closed 3 months ago

miroiu commented 3 months ago

📝 Description of the Change

This PR adds a CuttingLine control to Nodify that removes intersecting connections. The default gesture to start cutting is SHIFT+ALT+LeftClick.

Please note that for the connection style to change when intersecting, it's required to set NodifyEditor.EnableCuttingLinePreview to true. However, this has a great performance impact when many connections are created.

To enable cutting custom connections you must add the connection type to NodifyEditor.CuttingConnectionTypes:

// example adding the Line shape to the connection types that can be cut
NodifyEditor.CuttingConnectionTypes.Add(typeof(System.Windows.Shapes.Line));

cutting