Fix getCenter methods returning wrong value for scaled layers

This commit is contained in:
florianvazelle 2019-01-30 15:57:51 +01:00
parent 04f06140d3
commit 01f1daad51

View file

@ -470,7 +470,7 @@ var Tile = new Class({
*/
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)
{
return this.getTop(camera) + this.height / 2;
return (this.getTop(camera) + this.getBottom(camera)) / 2;
},
/**