From cf344c2ba78ed2619a82108a57f13c844981815c Mon Sep 17 00:00:00 2001 From: Jim Rodovich Date: Wed, 7 Jan 2015 17:31:46 -0600 Subject: [PATCH] Fix reflecting relative quadratic curves after absolute quadratic curves. --- src/shapes/path.class.js | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/src/shapes/path.class.js b/src/shapes/path.class.js index 1f85881f..a8302387 100644 --- a/src/shapes/path.class.js +++ b/src/shapes/path.class.js @@ -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':