Merge pull request #5150 from samme/fix/static-body-from-scaled-sprite

Fix static body position from scaled sprite
This commit is contained in:
Richard Davey 2020-07-13 12:13:13 +01:00 committed by GitHub
commit 7fa6d17e17
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -124,7 +124,7 @@ var StaticBody = new Class({
* @type {Phaser.Math.Vector2}
* @since 3.0.0
*/
this.position = new Vector2(gameObject.x - gameObject.displayOriginX, gameObject.y - gameObject.displayOriginY);
this.position = new Vector2(gameObject.x - (width * gameObject.originX), gameObject.y - (height * gameObject.originY));
/**
* The width of the Static Body's boundary, in pixels.