Skip to content

Commit 536f08a

Browse files
committed
Avoid deep diving into loads of functions
1 parent 67b787a commit 536f08a

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/tilemaps/components/GetTilesWithinWorldXY.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,16 @@ var pointEnd = new Vector2();
3131
*/
3232
var GetTilesWithinWorldXY = function (worldX, worldY, width, height, filteringOptions, camera, layer)
3333
{
34+
var worldToTileXY = layer.tilemapLayer.tilemap._convert.WorldToTileXY;
35+
3436
// Top left corner of the rect, rounded down to include partial tiles
35-
layer.tilemapLayer.worldToTileXY(worldX, worldY, true, pointStart, camera);
37+
worldToTileXY(worldX, worldY, true, pointStart, camera, layer);
3638

3739
var xStart = pointStart.x;
3840
var yStart = pointStart.y;
3941

4042
// Bottom right corner of the rect, rounded up to include partial tiles
41-
layer.tilemapLayer.worldToTileXY(worldX + width, worldY + height, false, pointEnd, camera);
43+
worldToTileXY(worldX + width, worldY + height, false, pointEnd, camera, layer);
4244

4345
var xEnd = Math.ceil(pointEnd.x);
4446
var yEnd = Math.ceil(pointEnd.y);

0 commit comments

Comments
 (0)