mirror of
https://github.com/photonstorm/phaser
synced 2024-11-28 07:31:11 +00:00
fillPoint draws the rect in the center of the x/y coordinates instead of the top-left
This commit is contained in:
parent
695a88b1c3
commit
bae63901d7
1 changed files with 10 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue