Skip to content

Commit

Permalink
fix(fabric.Path): Path Distance Measurement Inconsistency (#7511)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex authored Dec 3, 2021
1 parent e8f9eea commit 4e08db6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/util/path.js
Original file line number Diff line number Diff line change
Expand Up @@ -507,15 +507,15 @@
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 && nextStep > 0.0001) {
p = iterator(perc);
lastPerc = perc;
nextLen = calcLineLength(tempP.x, tempP.y, p.x, p.y);
// compare tmpLen each cycle with distance, decide next perc to test.
if ((nextLen + tmpLen) > distance) {
// we discard this step and we make smaller steps.
nextStep /= 2;
perc -= nextStep;
nextStep /= 2;
}
else {
tempP = p;
Expand Down

0 comments on commit 4e08db6

Please sign in to comment.