From 49542a68e5ffc1b927a6e5e4baa0f0302b1b34bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20V=C3=B6gele?= Date: Thu, 6 May 2021 09:00:50 +0200 Subject: [PATCH] Simplify foundry fixes --- src/foundry_fixes.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/foundry_fixes.js b/src/foundry_fixes.js index 56578d2..7098aeb 100644 --- a/src/foundry_fixes.js +++ b/src/foundry_fixes.js @@ -2,13 +2,10 @@ // https://gitlab.com/foundrynet/foundryvtt/-/issues/4705 export function getPixelsFromGridPosition(xGrid, yGrid) { - if (canvas.grid.isHex) { + if (canvas.grid.type !== CONST.GRID_TYPES.GRIDLESS) { return canvas.grid.grid.getPixelsFromGridPosition(yGrid, xGrid) } - const [x, y] = canvas.grid.grid.getPixelsFromGridPosition(xGrid, yGrid) - if (canvas.grid.type === CONST.GRID_TYPES.SQUARE) - return [y, x] - return [x, y] + return canvas.grid.grid.getPixelsFromGridPosition(xGrid, yGrid) } // Wrapper to fix a FoundryVTT bug that causes the return values of canvas.grid.grid.getPixelsFromGridPosition to be ordered inconsistently