InputHandler was using the wrong property in checkBoundsSprite when fixedToCamera (thanks @yig #1613)

This commit is contained in:
photonstorm 2015-02-14 19:10:06 +00:00
parent e9a77d95eb
commit ae198e9364
2 changed files with 9 additions and 8 deletions

View file

@ -155,6 +155,7 @@ Thanks to @pnstickne for vast majority of this update.
* Phaser.Ellipse.contains is now working again (thanks @spayton #1524) * Phaser.Ellipse.contains is now working again (thanks @spayton #1524)
* PIXI.WebGLRenderer.destroy has been fixed to decrement the `glContextId` and remove it from the PIXI.instances global. `Game.destroy` now hooks into this. This now means that you can now delete and create your Phaser game over and over without it crashing WebGL after the 4th attempt (#1260) * PIXI.WebGLRenderer.destroy has been fixed to decrement the `glContextId` and remove it from the PIXI.instances global. `Game.destroy` now hooks into this. This now means that you can now delete and create your Phaser game over and over without it crashing WebGL after the 4th attempt (#1260)
* World.setBounds if called after you had already started P2 Physics would incorrectly create a new collision group for the wall objects. P2.World now remembers the settings you provide for each wall and the collision group, and re-applies these settings should the world dimensions ever change (thanks @nextht #1455) * World.setBounds if called after you had already started P2 Physics would incorrectly create a new collision group for the wall objects. P2.World now remembers the settings you provide for each wall and the collision group, and re-applies these settings should the world dimensions ever change (thanks @nextht #1455)
* InputHandler was using the wrong property in `checkBoundsSprite` when fixedToCamera (thanks @yig #1613)
For changes in previous releases please see the extensive [Version History](https://github.com/photonstorm/phaser/blob/master/CHANGELOG.md). For changes in previous releases please see the extensive [Version History](https://github.com/photonstorm/phaser/blob/master/CHANGELOG.md).

View file

@ -1480,22 +1480,22 @@ Phaser.InputHandler.prototype = {
if (this.sprite.fixedToCamera && this.boundsSprite.fixedToCamera) if (this.sprite.fixedToCamera && this.boundsSprite.fixedToCamera)
{ {
if (this.sprite.cameraOffset.x < this.boundsSprite.camerOffset.x) if (this.sprite.cameraOffset.x < this.boundsSprite.cameraOffset.x)
{ {
this.sprite.cameraOffset.x = this.boundsSprite.camerOffset.x; this.sprite.cameraOffset.x = this.boundsSprite.cameraOffset.x;
} }
else if ((this.sprite.cameraOffset.x + this.sprite.width) > (this.boundsSprite.camerOffset.x + this.boundsSprite.width)) else if ((this.sprite.cameraOffset.x + this.sprite.width) > (this.boundsSprite.cameraOffset.x + this.boundsSprite.width))
{ {
this.sprite.cameraOffset.x = (this.boundsSprite.camerOffset.x + this.boundsSprite.width) - this.sprite.width; this.sprite.cameraOffset.x = (this.boundsSprite.cameraOffset.x + this.boundsSprite.width) - this.sprite.width;
} }
if (this.sprite.cameraOffset.y < this.boundsSprite.camerOffset.y) if (this.sprite.cameraOffset.y < this.boundsSprite.cameraOffset.y)
{ {
this.sprite.cameraOffset.y = this.boundsSprite.camerOffset.y; this.sprite.cameraOffset.y = this.boundsSprite.cameraOffset.y;
} }
else if ((this.sprite.cameraOffset.y + this.sprite.height) > (this.boundsSprite.camerOffset.y + this.boundsSprite.height)) else if ((this.sprite.cameraOffset.y + this.sprite.height) > (this.boundsSprite.cameraOffset.y + this.boundsSprite.height))
{ {
this.sprite.cameraOffset.y = (this.boundsSprite.camerOffset.y + this.boundsSprite.height) - this.sprite.height; this.sprite.cameraOffset.y = (this.boundsSprite.cameraOffset.y + this.boundsSprite.height) - this.sprite.height;
} }
} }
else else