Fix arcade body does not align with scaled parent object.

When a game object scaled, arcade body still calculate its position based on its original size instead of scaled one.
This commit is contained in:
Sean Bohan 2018-03-01 09:02:04 +08:00
parent 9a561ff385
commit 3f2e63fc17

View file

@ -788,8 +788,8 @@ var Body = new Class({
var sprite = this.gameObject;
this.position.x = sprite.x - sprite.displayOriginX + (sprite.scaleX * this.offset.x);
this.position.y = sprite.y - sprite.displayOriginY + (sprite.scaleY * this.offset.y);
this.position.x = sprite.x + sprite.scaleX * (this.offset.x - sprite.displayOriginX);
this.position.y = sprite.y + sprite.scaleY * (this.offset.y - sprite.displayOriginY);
this.updateCenter();