Closed Eschon closed 2 years ago
I suspect the problem lies with choosing the control points when normalising the command.
From the MDN description of the d attribute:
The start control point is the reflection of the end control point of the previous curve command about the current point. If the previous command wasn't a cubic Bézier curve, the start control point is the same as the curve starting point (current point).
As far as I can tell that distinction is currently not in the code. It always assumes that there is a control point from a previous curve command.
I'll try to get a PR ready since I kind of have an idea of how to solve this already.
good find!
Edit: I investigated a bit further and noticed the problem occurs on normalising not on reversing
I've noticed some problems
reversingnormalising certain paths with smooth cubic Bézier curves (s-Command).I've prepared two examples to illustrate the problem:
Example 1:
M249.834 243.462s120.037 20.777 149.951 26.898l129.125 22.261
Normalised:
M 249.834 243.462 C 499.668 486.924 369.871 264.239 399.78499999999997 270.36 L 528.91 292.62100000000004
Example 2:
M259.238 310.863s7.636.062 8.204-3.154c0 0 1.451-4.514-9.593-5.07 0 0-5.932-.186-4.292-3.278 0 0 .695-1.484 2.651-1.793
Normalised:
M 259.238 310.863 C 518.476 621.726 266.874 310.925 267.442 307.709 C 267.442 307.709 268.89300000000003 303.195 257.849 302.639 C 257.849 302.639 251.917 302.45300000000003 253.557 299.361 C 253.557 299.361 254.25199999999998 297.877 256.20799999999997 297.568