From c787b18fcbbe89800f490af5850fb3f703366af6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20V=C3=B6gele?= Date: Sun, 28 Jul 2024 23:11:47 +0200 Subject: [PATCH] Add 1 to hex positions before snapping to avoid rounding issues (fixes #334) --- src/foundry_imports.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/foundry_imports.js b/src/foundry_imports.js index 5580b57..c242cdc 100644 --- a/src/foundry_imports.js +++ b/src/foundry_imports.js @@ -195,7 +195,7 @@ export function highlightMeasurementNative( const pathUntilSpace = previousSegments.concat([{ray: new Ray(ray.A, center)}]); const distance = sum(canvas.grid.measureDistances(pathUntilSpace, {gridSpaces: true})); const color = this.dragRulerGetColorForDistance(distance); - const snapPoint = getSnapPointForToken(point.x, point.y, this.draggedEntity); + const snapPoint = getSnapPointForToken(point.x + 1, point.y + 1, this.draggedEntity); const [snapX, snapY] = getGridPositionFromPixels(snapPoint.x + 1, snapPoint.y + 1); highlightTokenShape.call(this, {x: snapX, y: snapY}, tokenShape, color, alpha); }