Merge pull request #5533 from veleek/veleek/isometricfix

Fix IsometricWorldToTileXY result
This commit is contained in:
Richard Davey 2021-02-04 15:17:54 +00:00 committed by GitHub
commit 641a7c5d99
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -50,8 +50,6 @@ var IsometricWorldToTileXY = function (worldX, worldY, snapToFloor, point, camer
tileWidth *= tilemapLayer.scaleX;
}
worldX -= tileWidth / 2;
var x = (snapToFloor) ? Math.floor((worldX / (tileWidth / 2) + worldY / (tileHeight / 2)) / 2) : ((worldX / (tileWidth / 2) + worldY / (tileHeight / 2)) / 2);
var y = (snapToFloor) ? Math.floor((worldY / (tileHeight / 2) - worldX / (tileWidth / 2)) / 2) : ((worldY / (tileHeight / 2) - worldX / (tileWidth / 2)) / 2);