Changed get_label_position func to account for edge curvature#457
Merged
ntamas merged 3 commits intoigraph:masterfrom Nov 17, 2021
Sriram-Pattabiraman:patch-1
Merged
Changed get_label_position func to account for edge curvature#457ntamas merged 3 commits intoigraph:masterfrom Sriram-Pattabiraman:patch-1
ntamas merged 3 commits intoigraph:masterfrom
Sriram-Pattabiraman:patch-1
Conversation
get_label_position now computes the bezier curve for the edge that would be drawn, then finds the parameter based midpoint by putting `.5` as the parameter and taking the output as the label position.
Member
|
This looks good, thanks! One problem that I have with this PR is that now there are three places in |
Previously, the code for calculating the bezier control points was repeated multiple times. Now, there is a function to calculate bezier curve control points accordingly using the start point, the end point, and the edge curvature in a function called get_bezier_control_points_for_curved_edge
Member
|
Looks good, thanks! I'll merge this if the CI tests pass. |
Member
|
CI failure is unrelated so merging, thanks a lot! |
…nts_for_curved_edge()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
get_label_position now computes the bezier curve for the edge that would be drawn, then finds the parameter based midpoint by putting
.5as the parameter and taking the output as the label position.