Fix reflecting relative quadratic curves after absolute quadratic curves.

This commit is contained in:
Jim Rodovich 2015-01-07 17:31:46 -06:00
parent aee62cb047
commit cf344c2ba7

View file

@ -130,8 +130,6 @@
controlY = 0, // current control point y
tempX,
tempY,
tempControlX,
tempControlY,
l = -this.pathOffset.x,
t = -this.pathOffset.y;
@ -343,20 +341,12 @@
controlX = x;
controlY = y;
}
else if (previous[0] === 't') {
// calculate reflection of previous control points for t
controlX = 2 * x - tempControlX;
controlY = 2 * y - tempControlY;
}
else if (previous[0] === 'q') {
// calculate reflection of previous control points for q
else {
// calculate reflection of previous control point
controlX = 2 * x - controlX;
controlY = 2 * y - controlY;
}
tempControlX = controlX;
tempControlY = controlY;
ctx.quadraticCurveTo(
controlX + l,
controlY + t,
@ -830,8 +820,7 @@
);
x = tempX;
y = tempY;
controlX = x + current[1];
controlY = y + current[2];
break;
case 'T':