From b3a84a6651ca3900a9aeaf4592fc125632193bde Mon Sep 17 00:00:00 2001 From: Luis Leiva Date: Mon, 11 Dec 2017 23:10:28 +0100 Subject: [PATCH] Fixed copy-paste typos :shit: --- sketchable.animate.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sketchable.animate.js b/sketchable.animate.js index 9bab48e..8782a33 100644 --- a/sketchable.animate.js +++ b/sketchable.animate.js @@ -43,7 +43,7 @@ } if (typeof events.animationstart === 'function') { - events.animationstart($instance, data); + events.animationstart(instance, data); } var raf = {}; // Trigger one animation per stroke. @@ -68,7 +68,7 @@ } // Advance global count and check if actual animation has ended. if (++pts === pointCount - 1 && typeof events.animationend === 'function') { - events.animationend($instance, data); + events.animationend(instance, data); } })(); @@ -96,17 +96,17 @@ * @param {object} [graphics] - Graphics options. */ function drawLine(sketch, coords, t, graphics) { - var prevPt = coords[t - 1]; var currPt = coords[t]; + var nextPt = coords[t + 1]; - if (sketch.data.firstPointSize && (t === 1 || currPt.strokeId !== prevPt.strokeId)) { - var pt = t > 1 ? currPt : prevPt; + if (sketch.data.firstPointSize && (t === 1 || currPt.strokeId !== nextPt.strokeId)) { + var pt = t > 1 ? nextPt : currPt; sketch.beginFill(sketch.data.strokeStyle).fillCircle(pt.x, pt.y, sketch.data.firstPointSize); } sketch.lineStyle(graphics.strokeStyle, graphics.lineWidth).beginPath(); - if (currPt.strokeId === prevPt.strokeId) { - sketch.line(prevPt.x, prevPt.y, currPt.x, currPt.y).stroke(); + if (currPt.strokeId === nextPt.strokeId) { + sketch.line(currPt.x, currPt.y, nextPt.x, nextPt.y).stroke(); } sketch.closePath(); };