mirror of
https://github.com/photonstorm/phaser
synced 2024-11-22 20:53:39 +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)
|
||||
{
|
||||
body = (body.hasOwnProperty('body')) ? body.body : body;
|
||||
|
||||
var pos;
|
||||
|
||||
switch (align)
|
||||
|
@ -1394,7 +1396,10 @@ var MatterPhysics = new Class({
|
|||
break;
|
||||
}
|
||||
|
||||
Body.setPosition(body, pos);
|
||||
if (pos)
|
||||
{
|
||||
Body.setPosition(body, pos);
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue