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
I was using your leaflet plugin and I found an issue with the trace with the "S" case with a pathData like this:
pathData = ['M', [lat0,lng0], 'S', [lat1,lng0], [lat1,lng0]]
for(var i = 0; i < this._points.length; i++){
point = this._points[i];
if(typeof point == 'string' || point instanceof String){
curCommand = point;
if(curCommand == 'Z'){
samples = samples.concat(this._linearTrace(t, curEndPoint, curStartPoint));
}
}else{
switch(curCommand){
(....)
case 'S':
p1 = this._reflectPoint(p2, curEndPoint);
p2 = point;
p3 = this._points[++i];
samples = samples.concat(this._cubicTrace(t, curEndPoint, p1, p2, p3));
p1 cannot be calculated because p2 is not defined yet. So I defined p2=curEndPoint on the case 'M' (the first point). And it work well.
case 'M': curStartPoint = point; curEndPoint = point; **p2=curEndPoint;** break;
Same kind of issue with the case T.
The text was updated successfully, but these errors were encountered:
Thanks @hpedro-github for highlighting this. I think your modification is correct according to the documentation for the S command:
Draws a cubic Bézier curve from the current point to (x,y). The first control point is assumed to be the reflection of the second control point on the previous command relative to the current point. (If there is no previous command or if the previous command was not an C, c, S or s, assume the first control point is coincident with the current point.)
Hello,
I was using your leaflet plugin and I found an issue with the trace with the "S" case with a pathData like this:
pathData = ['M', [lat0,lng0], 'S', [lat1,lng0], [lat1,lng0]]
p1 cannot be calculated because p2 is not defined yet. So I defined p2=curEndPoint on the case 'M' (the first point). And it work well.
case 'M': curStartPoint = point; curEndPoint = point; **p2=curEndPoint;** break;
Same kind of issue with the case T.
The text was updated successfully, but these errors were encountered: