fillPoint draws the rect in the center of the x/y coordinates instead of the top-left

This commit is contained in:
Richard Davey 2018-01-17 14:51:17 +00:00
parent 695a88b1c3
commit bae63901d7

View file

@ -261,6 +261,16 @@ var Graphics = new Class({
fillPoint: function (x, y, size)
{
if (!size || size < 1)
{
size = 1;
}
else
{
x -= (size / 2);
y -= (size / 2);
}
this.commandBuffer.push(
Commands.FILL_RECT,
x, y, size, size