Fixed copy-paste typos 💩

This commit is contained in:
Luis Leiva 2017-12-11 23:10:28 +01:00
parent f9f41a3509
commit b3a84a6651
1 changed files with 7 additions and 7 deletions

View File

@ -43,7 +43,7 @@
} }
if (typeof events.animationstart === 'function') { if (typeof events.animationstart === 'function') {
events.animationstart($instance, data); events.animationstart(instance, data);
} }
var raf = {}; // Trigger one animation per stroke. var raf = {}; // Trigger one animation per stroke.
@ -68,7 +68,7 @@
} }
// Advance global count and check if actual animation has ended. // Advance global count and check if actual animation has ended.
if (++pts === pointCount - 1 && typeof events.animationend === 'function') { 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. * @param {object} [graphics] - Graphics options.
*/ */
function drawLine(sketch, coords, t, graphics) { function drawLine(sketch, coords, t, graphics) {
var prevPt = coords[t - 1];
var currPt = coords[t]; var currPt = coords[t];
var nextPt = coords[t + 1];
if (sketch.data.firstPointSize && (t === 1 || currPt.strokeId !== prevPt.strokeId)) { if (sketch.data.firstPointSize && (t === 1 || currPt.strokeId !== nextPt.strokeId)) {
var pt = t > 1 ? currPt : prevPt; var pt = t > 1 ? nextPt : currPt;
sketch.beginFill(sketch.data.strokeStyle).fillCircle(pt.x, pt.y, sketch.data.firstPointSize); sketch.beginFill(sketch.data.strokeStyle).fillCircle(pt.x, pt.y, sketch.data.firstPointSize);
} }
sketch.lineStyle(graphics.strokeStyle, graphics.lineWidth).beginPath(); sketch.lineStyle(graphics.strokeStyle, graphics.lineWidth).beginPath();
if (currPt.strokeId === prevPt.strokeId) { if (currPt.strokeId === nextPt.strokeId) {
sketch.line(prevPt.x, prevPt.y, currPt.x, currPt.y).stroke(); sketch.line(currPt.x, currPt.y, nextPt.x, nextPt.y).stroke();
} }
sketch.closePath(); sketch.closePath();
}; };