-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Path Distance Measurement Inconsistency #7511
Conversation
for the lint!
I will add the test soon. |
src/util/path.js
Outdated
@@ -507,7 +507,7 @@ | |||
p, nextLen, nextStep = 0.01, angleFinder = segInfo.angleFinder, lastPerc; | |||
// nextStep > 0.0001 covers 0.00015625 that 1/64th of 1/100 | |||
// the path | |||
while (tmpLen < distance && perc <= 1 && nextStep > 0.0001) { | |||
while (tmpLen < distance && perc < (perc + nextStep) && nextStep > 0.0001) { |
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.
mmm this smells like infinite loop
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.
can be this just < ( 1 + nextStep ), would this work?
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.
I think we can remove the percentage check. Only tmpLen < distance && nextStep > 0.0001
are enough
@melchiar since you are the highest text on a path stakeholder here, do you want to have a look at this code? |
Sorry, been crazy busy and haven't had time to test yet. I will try to take a look on Monday |
Looks good to me! |
You can formally approve next time! |
close: #7327