Closed veillette closed 10 years ago
@bereaphysics thanks for this issue report. @jonathanolson I also saw a problem like this when trying to use smoothQuadraticCurveTo a while ago, can you take a look?
Thanks for finding this!
Looks like since the first quadratic is linear, it gets simplified internally to a line, and the getSmoothQuadraticControlPoint() will just return the last point (instead of the reflection).
Should have it fixed shortly.
For reference, here is the desired behavior:
smoothQuadraticCurveTo() is currently equivalent to lineTo().
The problems lies in the control point that is invoked in getSmoothQuadraticControlPoint().
When you used lineTo, you get a line from an initial point to a destination point. For an array of points, an automatic control point can be picked from the point just before the initial point or point that comes after the destination point. In the current implementation the control point is the same as the initial point. As a result these three points (initial, destination and control) are collinear and smoothQuadraticCurveTo results in a straight line.