Add comments about re-used code in routinglib

This commit is contained in:
Manuel Vögele
2022-10-15 16:37:47 +02:00
parent 7dcb8b5c71
commit 2cf97e2804
+3
View File
@@ -27,6 +27,7 @@ export function sum(arr) {
return arr.reduce((a, b) => a + b, 0); return arr.reduce((a, b) => a + b, 0);
} }
// A copy of this function lives in the routinglib module
export function getHexTokenSize(token) { export function getHexTokenSize(token) {
const size = token.document.width; const size = token.document.width;
if (token.document.height !== size) { if (token.document.height !== size) {
@@ -61,6 +62,7 @@ export function getEntityCenter(token) {
return token.center; return token.center;
} }
// A copy of this function lives in the routinglib module
export function getAltOrientationFlagForToken(token, size) { export function getAltOrientationFlagForToken(token, size) {
const hexSizeSupport = game.modules.get("hex-size-support").api; const hexSizeSupport = game.modules.get("hex-size-support").api;
if (hexSizeSupport) { if (hexSizeSupport) {
@@ -171,6 +173,7 @@ export function getAreaFromPositionAndShape(position, shape) {
}); });
} }
// A copy of this function lives in the routinglib module
export function getTokenShape(token) { export function getTokenShape(token) {
let scene = canvas.scene; let scene = canvas.scene;
if (scene.grid.type === CONST.GRID_TYPES.GRIDLESS) { if (scene.grid.type === CONST.GRID_TYPES.GRIDLESS) {