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

bug fix of maximum call stack size exceeded #18

Open
SouthPWN opened this issue Jul 26, 2022 · 0 comments
Open

bug fix of maximum call stack size exceeded #18

SouthPWN opened this issue Jul 26, 2022 · 0 comments

Comments

@SouthPWN
Copy link

When the points overlap or the accuracy of the process of finding the middle point is lost, the program will fall into an endless loop, resulting in the error "maximum call stack size exceeded".
Found the problem in the file "\node_modules_svg-path-to-polygons@0.1.0@svg-path-to-polygons\svg-path-to-polygons.js:79:4".
The code is
sampleCubicBézier(x0, y0, x01, y01, x012, y012, x0123, y0123);sampleCubicBézier(x0123, y0123, x123, y123, x23, y23, x3, y3);.May cause dead circulation.
So I suggest changing it to
' if(x1!=x01||y1!=y01||x2!=x012||y2!=y012||x3!=x0123||y3!=y0123){ sampleCubicBézier(x0, y0, x01, y01, x012, y012, x0123, y0123); } if(x0!=x0123||y0!=y0123||x1!=x123||y1!=y123||x2!=x23||y2!=y23){ sampleCubicBézier(x0123, y0123, x123, y123, x23, y23, x3, y3); }
This can avoid the cycle of birth and death.

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

No branches or pull requests

1 participant