You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my "post-processing" fix I also "re-parse" and normalize the current pathData, which should be obsolete since the lib already does this on initial parsing (but I wasn't smart enough to understand the original code)
check if we have any relative commands => convert to absolute
convert shorthand commands to their longhand equivalents
Is there an easier way to solve this issue?
The text was updated successfully, but these errors were encountered:
herrstrietzel
changed the title
elliptic arcTo commands: getPointAtLength() returns unexpected value
elliptic Arc commands: getPointAtLength() returns unexpected value
Aug 8, 2023
Thanks for this great library!
Not sure if I've missed a point:
but it seems like svg-path-properties version of
getPointAtLength()
has issues with ellipticalA
arc commands.A path data
d
value ofM 50 0 a 50 30 22 0 1 50 75
would return midpoint (pathlength/2) coordinates using the nativegetPointAtLength()
{x:115.578, y:24.136}
but it returns using svg-path-properties
{x: 122.625, y:32.651}
See this codepen example.
(This example compares the native method against svg-path-properties equivalent.)
As a clunky (but working) workaround I converted elliptical arctos to cubic bézier approximations:
d
string contains anyA
/a
commands at allIn my "post-processing" fix I also "re-parse" and normalize the current pathData, which should be obsolete since the lib already does this on initial parsing (but I wasn't smart enough to understand the original code)
Is there an easier way to solve this issue?
The text was updated successfully, but these errors were encountered: