-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
Obtaining length of some Arc can exceed maximum call stack #91
Comments
Succeeds:
Fails:
|
|
Rather than bisecting over and over again |
Deciding ahead of time how many segments to use can lead to unprecise approximations for really large arcs. But yes, this is a problem and a bug. Just not sure how to solve it properly |
Could always decouple with |
That wouldnt work since this function is expected to return directly. Cant break user expectation here. I am not following dom standards to the max but this lib still remains a drop in replacement for a real dom :D |
I'd think return what you have on a Haven't gone back and reviewed what scopes are available but could maybe keep a count of recursions somewhere and return before the error. |
or maybe rewrite the recursion as a while loop (which should be possible if it is tail call optimizable). |
M 216.1027854225359 271.1209756706295 A 46.283096266347606 28.725390201836586 2.166914683186652 0 1 287.49723659993464 261.4021001840497
M 164.16806031012334 277.88997477304815 A 112.78408575681235 76.52010425131027 -175.93248043341987 1 1 158.42630883977398 299.49871866124164
RangeError: Maximum call stack size exceeded
I believe the issue may be related to early return of an estimate being delayed too deeply into the recursive
length
call stack.Perhaps this
0.00001
constant is the wrong size. Perhaps a count of call stack depth is required. Or perhaps simply atry/catch
where the result is returned onRangeError
.svgdom/src/utils/pathUtils.js
Line 351 in 0a2a9c9
The text was updated successfully, but these errors were encountered: