mirror of
https://github.com/photonstorm/phaser
synced 2025-01-07 10:48:51 +00:00
Fix getCenter methods returning wrong value for scaled layers
This commit is contained in:
parent
04f06140d3
commit
01f1daad51
1 changed files with 2 additions and 2 deletions
|
@ -470,7 +470,7 @@ var Tile = new Class({
|
||||||
*/
|
*/
|
||||||
getCenterX: function (camera)
|
getCenterX: function (camera)
|
||||||
{
|
{
|
||||||
return this.getLeft(camera) + this.width / 2;
|
return (this.getLeft(camera) + this.getRight(camera)) / 2;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -486,7 +486,7 @@ var Tile = new Class({
|
||||||
*/
|
*/
|
||||||
getCenterY: function (camera)
|
getCenterY: function (camera)
|
||||||
{
|
{
|
||||||
return this.getTop(camera) + this.height / 2;
|
return (this.getTop(camera) + this.getBottom(camera)) / 2;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue