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.3k stars 208 forks source link

[Feature] Configurable arrowhead for connections #44

Closed miroiu closed 1 year ago

miroiu commented 1 year ago

Describe the solution you'd like

The BaseConnection can display an arrowhead at the end of the line if ArrowSize is valid. I would like to be able to specify at which end of the line the arrow should be displayed. (possible values for ArrowHeadEnds: None, Start, End, Both).

Don't forget to add the new setting to the Playground app.

Optional: Customize the shape of the arrowhead: Arrow (default), Ellipse, Rectangle

AnvarAslam commented 1 year ago

Can I Solve These Issue & U Can Guide Me To Solve It

miroiu commented 1 year ago

Hi @AnvarAslam! You already have #37 assigned to you. Once you solve that one you can also pick this one unless someone else starts working on it.

vinicius-nicolete commented 1 year ago

Hello @miroiu , can I work in this issue?

miroiu commented 1 year ago

Hi @vinicius-nicolete ! Sure, you can have it.

vinicius-nicolete commented 1 year ago

Hi @miroiu, I have some trouble for testing. I can test in the Playground project, right? There need to be a new creation of a setting or already have a setting there for doing that?

image

miroiu commented 1 year ago

Hi @vinicius-nicolete, you have to add a new setting in the playground app for the arrowhead.

miroiu commented 1 year ago

Just to add some information here: the BaseConnection class is the place to add the arrowhead. There is the DrawArrowGeometry method that can be used to draw the arrow in the correct position. This method already knows how to draw the arrowhead on each end of the line depending on the Direction property. The direction only switches the meaning of the ArrowHeadEnds.Start and ArrowHeadEnds.End and should be fairly easy to implement. I think that ArrowHeadEnds.Both can be implemented by calling GetArrowHeadPoints again with the target and source reversed.

mshumayl commented 1 year ago

Hi @miroiu, if it's okay, I'd like to work on this.

miroiu commented 1 year ago

Hi @mshumayl, you can have it!

miroiu commented 1 year ago

Hi @mshumayl ! Thank you very much for your contribution.