Skip to content

Commit 7d39bf9

Browse files
committed
Tidy return statements
1 parent ef2d4f6 commit 7d39bf9

2 files changed

Lines changed: 4 additions & 8 deletions

File tree

src/tilemaps/components/HexagonalWorldToTileY.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,11 @@ var HexagonalWorldToTileY = function (worldY, snapToFloor, camera, layer)
3737
tileHeight *= tilemapLayer.scaleY;
3838
}
3939

40-
var sidel = layer.hexSideLength;
40+
var len = layer.hexSideLength;
4141

42-
var rowHeight = ((tileHeight - sidel) / 2 + sidel);
42+
var rowHeight = ((tileHeight - len) / 2 + len);
4343

44-
return snapToFloor
45-
? Math.floor(worldY / rowHeight)
46-
: worldY / rowHeight;
44+
return (snapToFloor) ? Math.floor(worldY / rowHeight) : worldY / rowHeight;
4745
};
4846

4947
module.exports = HexagonalWorldToTileY;

src/tilemaps/components/StaggeredWorldToTileY.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@ var StaggeredWorldToTileY = function (worldY, snapToFloor, camera, layer)
3737
tileHeight *= tilemapLayer.scaleY;
3838
}
3939

40-
return snapToFloor
41-
? Math.floor(worldY / (tileHeight / 2))
42-
: worldY / (tileHeight / 2);
40+
return (snapToFloor) ? Math.floor(worldY / (tileHeight / 2)) : worldY / (tileHeight / 2);
4341
};
4442

4543
module.exports = StaggeredWorldToTileY;

0 commit comments

Comments
 (0)