mirror of https://github.com/luileito/jsketch.git
Fixed copy-paste typos 💩
This commit is contained in:
parent
f9f41a3509
commit
b3a84a6651
|
|
@ -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();
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue