-
Notifications
You must be signed in to change notification settings - Fork 1.5k
network - make negative scaleFactor reverse middle arrow correctly #3474
network - make negative scaleFactor reverse middle arrow correctly #3474
Conversation
Hi there! Great of you that you are willing to contribute. Can you please base the pull request on the Also, I'm not really sure how this actually reverses the arrow. I'll wait for the change to |
914a9f0
to
92b02ba
Compare
hmmm it got all messed up when I rebased it to develop, maybe better to start over ?? It's really just the one line. What reverses the arrow is not this change, but you using negative scale factor. But without my change, the scaling is wrong and the arrow becomes tiny when reversed. |
92b02ba
to
01ea991
Compare
ah I think I fixed the rebase :) |
Yes, please make a new PR and close this one. (Even if it is one line!) Edit: Never mind, the rebase is good. I stand in awe that you managed that! |
no need now, did a hard reset to develop, cherry-picked my commit and force-pushed it |
There is still enough room there for me to stand in amazement.... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution! Really awesome and elegant solution to the bug!
Addendum to almende#3474. Updated the documentation, so that users can know about flipping the middle arrow with a negative scale factor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one belated review comment: would you mind adjusting the docs for edges.arrows.middle, that users are aware that the direction of the middle arrow can be flipped by using negative values?
Oh, merged already.....never mind, I'll do it myself.
* Network: Adjust documentation for arrows.middle.scaleFactor Addendum to #3474. Updated the documentation, so that users can know about flipping the middle arrow with a negative scale factor. * Adjusted text for review
…3488) * Network: Adjust documentation for arrows.middle.scaleFactor Addendum to almende#3474. Updated the documentation, so that users can know about flipping the middle arrow with a negative scale factor. * Adjusted text for review
This fix makes it possible to use negative
scaleFactor
(eg. -1) to flip the middle arrow.The bug is with this line:
15 * scaleFactor + 3 * lineWidth
- if scale factor is negative, lineWidth is applied in the wrong direction and the arrow gets smaller instead of larger.Old behavior - wrong scaling when reversed (gets worse when selected):
New behavior - scales correctly