Skip to content

Commit

Permalink
On hex, use static token size if no token is configured via the options
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelVo committed Oct 16, 2022
1 parent 9f7743f commit 4ae21da
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,21 @@ function initializePathfinder(from, to, options) {
? token.losHeight
: token.document.elevation;
}
if (canvas.grid.isHex) {
tokenData.size = getHexTokenSize(token);
tokenData.altOrientation = getAltOrientationFlagForToken(token, tokenData.size);
}
} else {
tokenData = {width: 1, height: 1};
elevation = elevation ?? 0;
if (canvas.grid.isHex) {
tokenData.size = 1;
tokenData.altOrientation = false;
}
}

tokenData.elevation = elevation;

if (canvas.grid.isHex) {
tokenData.size = getHexTokenSize(token);
tokenData.altOrientation = getAltOrientationFlagForToken(token, tokenData.size);
}

const levelIndex = cache.getLevelIndexForElevation(elevation);
if (canvas.grid.type === CONST.GRID_TYPES.GRIDLESS) {
const tokenSize = Math.max(tokenData.width, tokenData.height);
Expand Down

0 comments on commit 4ae21da

Please sign in to comment.