diff --git a/CHANGELOG.md b/CHANGELOG.md index 90703a2..6cf58ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,7 @@ ## In development +### Bugfixes +- Fixed a bug where Drag Ruler wouldn't work at all on hex grids when the Hex Token Size Support isn't installed + ### Translation - Added chinese translation (thanks to zeteticl) diff --git a/src/util.js b/src/util.js index 1cb0f56..6ef2752 100644 --- a/src/util.js +++ b/src/util.js @@ -117,21 +117,24 @@ export function applyTokenSizeOffset(waypoints, token) { const tokenSize = getTokenSize(token); const waypointOffset = {x: 0, y: 0}; if (canvas.grid.isHex) { - const isAltOrientation = CONFIG.hexSizeSupport.getAltOrientationFlag(token); - if (canvas.grid.grid.options.columns) { - if (tokenSize.w % 2 === 0) { - waypointOffset.x = canvas.grid.w / 2; - if (!isAltOrientation) - waypointOffset.x *= -1; - } - } - else { - if (tokenSize.h % 2 === 0) { - waypointOffset.y = canvas.grid.h / 2; - if (isAltOrientation) - waypointOffset.y *= -1; + if (game.modules.get("hex-size-support")?.active) { + const isAltOrientation = CONFIG.hexSizeSupport.getAltOrientationFlag(token); + if (canvas.grid.grid.options.columns) { + if (tokenSize.w % 2 === 0) { + waypointOffset.x = canvas.grid.w / 2; + if (!isAltOrientation) + waypointOffset.x *= -1; + } + } + else { + if (tokenSize.h % 2 === 0) { + waypointOffset.y = canvas.grid.h / 2; + if (isAltOrientation) + waypointOffset.y *= -1; + } } } + // If hex size support isn't active leave the waypoints like they are } else { if (tokenSize.w % 2 === 0) {