mirror of
https://github.com/wassname/phaser.git
synced 2026-07-23 13:00:41 +08:00
Fixed issue with physics world not being centered if you resized it.
This commit is contained in:
@@ -168,11 +168,16 @@ Phaser.Physics.World.prototype.setBounds = function (x, y, width, height, left,
|
||||
{
|
||||
this.removeBody(this.bounds);
|
||||
|
||||
for (var i = this.bounds.shapes.length - 1; i >= 0; i--)
|
||||
var i = this.bounds.shapes.length;
|
||||
|
||||
while (i--)
|
||||
{
|
||||
var shape = this.bounds.shapes[i];
|
||||
this.bounds.removeShape(shape);
|
||||
}
|
||||
|
||||
this.bounds.position[0] = this.game.math.px2p(cx);
|
||||
this.bounds.position[1] = this.game.math.px2p(cy);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user