mirror of
https://github.com/photonstorm/phaser
synced 2025-02-26 04:17:08 +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)
|
fillPoint: function (x, y, size)
|
||||||
{
|
{
|
||||||
|
if (!size || size < 1)
|
||||||
|
{
|
||||||
|
size = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
x -= (size / 2);
|
||||||
|
y -= (size / 2);
|
||||||
|
}
|
||||||
|
|
||||||
this.commandBuffer.push(
|
this.commandBuffer.push(
|
||||||
Commands.FILL_RECT,
|
Commands.FILL_RECT,
|
||||||
x, y, size, size
|
x, y, size, size
|
||||||
|
|
Loading…
Add table
Reference in a new issue