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

[Question] Increase frequency of node position updates on move #137

Closed Pyritie closed 2 months ago

Pyritie commented 2 months ago

I'm using nodify to make a little bezier curve editor in my application (we're using it for an actual legit node graph elsewhere, so reusing a library that handled dragging things and panning on a canvas sounded like a good idea), but my bindings to ItemContainer.Location and Connector.Anchor are only being updated when letting go of the mouse after moving nodes around.

Is there a way for these properties to be updated as the nodes are being moved around, or is there some other property or event I could use for this? I'd like to update the bezier curve as I'm dragging the nodes around, it would look nicer!

Thank you for the great library!

miroiu commented 2 months ago

To enable real-time ItemContainer.Location updates, set NodifyEditor.EnableDraggingContainersOptimizations to false. As for the Anchor, that's controlled by the Connector.EnableOptimizations static field.

The new dragging behavior can be seen in the minimap of the playground editor:

realtime

Let me know if you have more questions.

Pyritie commented 2 months ago

That works perfectly, thank you!