Closed stefanw closed 1 year ago
@claudep Happy new year and thanks for the merge. Would you consider a patch release for this?
Happy new year, and happy new release :smile:
Thanks, and Happy New Year! I'm about to post the first bug of the year... ;)
Thanks! Embarrassingly, I made a small mistake in the fix 😞 . New PR is at #372 this time with a test.
Thanks for the quick fix. I just released 1.5.1.
I noticed weird SVG curves coming out of the internal conversion from quadratic Bézier curves to cubic ones.
Here's an example of what the mistake can looks like in practice.
svglib
where the control points of the previoust
/T
commands are off.I tracked this down to this code in
convertPath
. The definition of thet
/T
commands is:So where does the control point from the previous command come from?
svglib
takes the previously stored last two points and assumes the first one to be the control point of the previous quadratic Bézier curve. However, the point is actually the second control point of a cubic Bézier curve (because a previousQ
/q
command has been converted to cubic).The solution would be to store the control point of the last quadratic Bézier curve in a variable and use that when the next
t
/T
command comes along. I will prepare a PR for this.