Skip to content
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

Merged
merged 5 commits into from
Dec 3, 2021
Merged

Path Distance Measurement Inconsistency #7511

merged 5 commits into from
Dec 3, 2021

Conversation

0xlkda
Copy link
Contributor

@0xlkda 0xlkda commented Nov 22, 2021

close: #7327

src/util/path.js Outdated Show resolved Hide resolved
for the lint!
@0xlkda
Copy link
Contributor Author

0xlkda commented Nov 23, 2021

I will add the test soon.

@0xlkda 0xlkda marked this pull request as draft November 23, 2021 06:58
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) {
Copy link
Member

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

Copy link
Member

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?

Copy link
Contributor Author

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

@0xlkda
Copy link
Contributor Author

0xlkda commented Nov 23, 2021

Some animate ezgif com-gif-maker

@asturur
Copy link
Member

asturur commented Nov 26, 2021

@melchiar since you are the highest text on a path stakeholder here, do you want to have a look at this code?
I think is fine believe it will work fine.

@asturur asturur marked this pull request as ready for review November 26, 2021 00:14
@melchiar
Copy link
Member

@melchiar since you are the highest text on a path stakeholder here, do you want to have a look at this code? I think is fine believe it will work fine.

Sorry, been crazy busy and haven't had time to test yet. I will try to take a look on Monday

@melchiar
Copy link
Member

melchiar commented Dec 2, 2021

Looks good to me!

@asturur
Copy link
Member

asturur commented Dec 3, 2021

You can formally approve next time!

@asturur asturur merged commit 4e08db6 into fabricjs:master Dec 3, 2021
@0xlkda 0xlkda deleted the patch-1 branch December 4, 2021 08:42
rockerBOO pushed a commit to rockerBOO/fabric.js that referenced this pull request Jan 12, 2022
@asturur asturur mentioned this pull request Jan 26, 2022
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.

Path Distance Measurement Inconsistency
3 participants