mirror of
https://github.com/photonstorm/phaser
synced 2025-02-16 22:18:29 +00:00
More robust checks
This commit is contained in:
parent
0d66c98ff0
commit
e27914792e
1 changed files with 6 additions and 1 deletions
|
@ -1349,6 +1349,8 @@ var MatterPhysics = new Class({
|
||||||
*/
|
*/
|
||||||
alignBody: function (body, x, y, align)
|
alignBody: function (body, x, y, align)
|
||||||
{
|
{
|
||||||
|
body = (body.hasOwnProperty('body')) ? body.body : body;
|
||||||
|
|
||||||
var pos;
|
var pos;
|
||||||
|
|
||||||
switch (align)
|
switch (align)
|
||||||
|
@ -1394,7 +1396,10 @@ var MatterPhysics = new Class({
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
Body.setPosition(body, pos);
|
if (pos)
|
||||||
|
{
|
||||||
|
Body.setPosition(body, pos);
|
||||||
|
}
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Reference in a new issue