Skip to content

Commit bca3df1

Browse files
authored
Merge pull request phaserjs#3541 from josephjaniga/staticbody-offset
[bugfix] StaticBody.setOffset fix for issue phaserjs#3465
2 parents 2df61ab + 8ee9805 commit bca3df1

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/physics/arcade/StaticBody.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,8 +443,14 @@ var StaticBody = new Class({
443443

444444
this.world.staticTree.remove(this);
445445

446+
this.position.x -= this.offset.x;
447+
this.position.y -= this.offset.y;
448+
446449
this.offset.set(x, y);
447450

451+
this.position.x += this.offset.x;
452+
this.position.y += this.offset.y;
453+
448454
this.updateCenter();
449455

450456
this.world.staticTree.insert(this);

0 commit comments

Comments
 (0)