mirror of
https://github.com/photonstorm/phaser
synced 2024-11-10 23:24:41 +00:00
Merge pull request #3541 from josephjaniga/staticbody-offset
[bugfix] StaticBody.setOffset fix for issue #3465
This commit is contained in:
commit
bca3df1064
1 changed files with 6 additions and 0 deletions
|
@ -443,8 +443,14 @@ var StaticBody = new Class({
|
|||
|
||||
this.world.staticTree.remove(this);
|
||||
|
||||
this.position.x -= this.offset.x;
|
||||
this.position.y -= this.offset.y;
|
||||
|
||||
this.offset.set(x, y);
|
||||
|
||||
this.position.x += this.offset.x;
|
||||
this.position.y += this.offset.y;
|
||||
|
||||
this.updateCenter();
|
||||
|
||||
this.world.staticTree.insert(this);
|
||||
|
|
Loading…
Reference in a new issue