Skip to content

Conversation

VincentK-ZA
Copy link

We'd like to be able to configure bezier curve connectors to make a straight line when the difference between the two anchors is negligible.

In this PR I've "hijacked" the margin param as an easy way to add this functionality, where if the difference between anchors is less than the margin, the minorAnchor offset is not added.

straight-bezier

Please let me know your thoughts on this.

It might be worthwhile exposing the minorAnchor property through the params as well.
I realize setting minorAnchor to 0 would also cause the bezier to be straight, but we would like to keep that offset when they are different.
One thought I had based on this PR is to scale the minorAnchor based on the difference between anchor points. So that if they are close together, minorAnchor goes to 0, giving straight lines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant