Skip to content

Commit bae6390

Browse files
committed
fillPoint draws the rect in the center of the x/y coordinates instead of the top-left
1 parent 695a88b commit bae6390

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/gameobjects/graphics/Graphics.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,16 @@ var Graphics = new Class({
261261

262262
fillPoint: function (x, y, size)
263263
{
264+
if (!size || size < 1)
265+
{
266+
size = 1;
267+
}
268+
else
269+
{
270+
x -= (size / 2);
271+
y -= (size / 2);
272+
}
273+
264274
this.commandBuffer.push(
265275
Commands.FILL_RECT,
266276
x, y, size, size

0 commit comments

Comments
 (0)