Skip to content

Commit

Permalink
Revert "Fixed #6996. Updated calculation for widthInPixels and height…
Browse files Browse the repository at this point in the history
…InPixels in MapData. Thanks @ptantiku"

This reverts commit ab88e71.
  • Loading branch information
zekeatchan committed Jan 6, 2025
1 parent ab88e71 commit ae565cd
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 41 deletions.
13 changes: 0 additions & 13 deletions src/tilemaps/parsers/tiled/ParseJSONTiled.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,6 @@ var ParseJSONTiled = function (name, source, insertNull)
mapData.hexSideLength = json.hexsidelength;
mapData.staggerAxis = json.staggeraxis;
mapData.staggerIndex = json.staggerindex;

if (mapData.staggerAxis === 'y')
{
var triangleHeight = (mapData.tileHeight - mapData.hexSideLength) / 2;
mapData.widthInPixels = mapData.tileWidth * (mapData.width + 0.5);
mapData.heightInPixels = mapData.height * (mapData.hexSideLength + triangleHeight) + triangleHeight;
}
else
{
var triangleWidth = (mapData.tileWidth - mapData.hexSideLength) / 2;
mapData.widthInPixels = mapData.width * (mapData.hexSideLength + triangleWidth) + triangleWidth;
mapData.heightInPixels = mapData.tileHeight * (mapData.height + 0.5);
}
}

mapData.layers = ParseTileLayers(json, insertNull);
Expand Down
28 changes: 0 additions & 28 deletions src/tilemaps/parsers/tiled/ParseTileLayers.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@ var ParseTileLayers = function (json, insertNull)
var gidInfo;
var tile;
var blankTile;
var triangleHeight;
var triangleWidth;

var output = [];
var x = 0;
Expand Down Expand Up @@ -142,19 +140,6 @@ var ParseTileLayers = function (json, insertNull)
layerData.hexSideLength = json.hexsidelength;
layerData.staggerAxis = json.staggeraxis;
layerData.staggerIndex = json.staggerindex;

if (layerData.staggerAxis === 'y')
{
triangleHeight = (layerData.tileHeight - layerData.hexSideLength) / 2;
layerData.widthInPixels = layerData.tileWidth * (layerData.width + 0.5);
layerData.heightInPixels = layerData.height * (layerData.hexSideLength + triangleHeight) + triangleHeight;
}
else
{
triangleWidth = (layerData.tileWidth - layerData.hexSideLength) / 2;
layerData.widthInPixels = layerData.width * (layerData.hexSideLength + triangleWidth) + triangleWidth;
layerData.heightInPixels = layerData.tileHeight * (layerData.height + 0.5);
}
}

for (var c = 0; c < curl.height; c++)
Expand Down Expand Up @@ -236,19 +221,6 @@ var ParseTileLayers = function (json, insertNull)
layerData.hexSideLength = json.hexsidelength;
layerData.staggerAxis = json.staggeraxis;
layerData.staggerIndex = json.staggerindex;

if (layerData.staggerAxis === 'y')
{
triangleHeight = (layerData.tileHeight - layerData.hexSideLength) / 2;
layerData.widthInPixels = layerData.tileWidth * (layerData.width + 0.5);
layerData.heightInPixels = layerData.height * (layerData.hexSideLength + triangleHeight) + triangleHeight;
}
else
{
triangleWidth = (layerData.tileWidth - layerData.hexSideLength) / 2;
layerData.widthInPixels = layerData.width * (layerData.hexSideLength + triangleWidth) + triangleWidth;
layerData.heightInPixels = layerData.tileHeight * (layerData.height + 0.5);
}
}
var row = [];

Expand Down

0 comments on commit ae565cd

Please sign in to comment.