Now using new strokePoints method

This commit is contained in:
Richard Davey 2017-10-25 16:04:48 +01:00
parent 8ab00112bf
commit 475091ef41

View file

@ -13,23 +13,8 @@ var Draw = function (graphics, pointsTotal)
{
if (pointsTotal === undefined) { pointsTotal = 32; }
var start = this.getStartPoint();
var points = this.getPoints(pointsTotal);
graphics.beginPath();
graphics.moveTo(start.x, start.y);
for (var i = 1; i < points.length; i++)
{
graphics.lineTo(points[i].x, points[i].y);
}
graphics.strokePath();
graphics.closePath();
// So you can chain graphics calls
return graphics;
return graphics.strokePoints(this.getPoints(pointsTotal));
};
module.exports = Draw;