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.
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.
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, theminorAnchor
offset is not added.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
to0
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.