Added Graphics.fillPoint, fillPointShape and lineBetween methods.

This commit is contained in:
Richard Davey 2017-03-30 01:47:15 +01:00
parent 709819d601
commit 47e6cff967

View file

@ -195,6 +195,23 @@ var Graphics = new Class({
return this;
},
// POINT
fillPointShape: function (point, size)
{
return this.fillPoint(point.x, point.y, size);
},
fillPoint: function (x, y, size)
{
this.commandBuffer.push(
Commands.FILL_RECT,
x, y, size, size
);
return this;
},
// TRIANGLE
fillTriangleShape: function (triangle)
@ -236,6 +253,17 @@ var Graphics = new Class({
return this.lineTo(line.x2, line.y2);
},
lineBetween: function (x1, y1, x2, y2)
{
this.beginPath();
this.moveTo(x1, y1);
this.lineTo(x2, y2);
this.strokePath();
this.closePath();
return this;
},
lineTo: function (x, y)
{
this.commandBuffer.push(