Use token.center instead of calculating the center manually
This commit is contained in:
+2
-3
@@ -133,10 +133,9 @@ export function getColorForDistanceAndToken(distance, token, ranges = null) {
|
||||
export function getMovedDistanceFromToken(token) {
|
||||
const terrainRulerAvailable = game.modules.get("terrain-ruler")?.active;
|
||||
const history = getMovementHistory(token);
|
||||
const tokenPos = {x: token.x, y: token.y};
|
||||
let tokenPos = {x: token.x, y: token.y};
|
||||
if (canvas.grid.type === CONST.GRID_TYPES.GRIDLESS) {
|
||||
tokenPos.x += token.w / 2;
|
||||
tokenPos.y += token.h / 2;
|
||||
tokenPos = token.center;
|
||||
}
|
||||
const segments = CONFIG.Canvas.rulerClass
|
||||
.dragRulerGetRaysFromWaypoints(history, tokenPos)
|
||||
|
||||
Reference in New Issue
Block a user