The Tilemaps.Tile.getBounds method would take a camera parameter but then not pass it to the methods called internally, thus ignoring it. It now factors the camera into the returned Rectangle.

This commit is contained in:
Richard Davey 2021-10-05 21:52:54 +01:00
parent 234ba03b35
commit 7934613e8f

View file

@ -492,10 +492,10 @@ var Tile = new Class({
{
if (output === undefined) { output = new Rectangle(); }
output.x = this.getLeft();
output.y = this.getTop();
output.width = this.getRight() - output.x;
output.height = this.getBottom() - output.y;
output.x = this.getLeft(camera);
output.y = this.getTop(camera);
output.width = this.getRight(camera) - output.x;
output.height = this.getBottom(camera) - output.y;
return output;
},