diff --git a/CHANGELOG.md b/CHANGELOG.md index 8245b95..301476b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 1.4.4 +### Bugfixes +- Fix snapping for tokens that are smaller than 1x1 + + + ## 1.4.3 ### System compatibility - Drag Ruler's Generic SpeedProvider is now aware of good default values for the Savage Worlds Adventure Edition game system diff --git a/src/util.js b/src/util.js index a17f2b9..bacb6d0 100644 --- a/src/util.js +++ b/src/util.js @@ -16,7 +16,7 @@ export function getSnapPointForToken(x, y, token) { return new PIXI.Point(...canvas.grid.getCenter(x, y)) } } - if (canvas.grid.isHex || token.data.width % 2 === 1) { + if (canvas.grid.isHex || Math.round(token.data.width) % 2 === 1 || token.data.width < 1) { return new PIXI.Point(...canvas.grid.getCenter(x, y)) } const [snappedX, snappedY] = canvas.grid.getCenter(x - canvas.grid.w / 2, y - canvas.grid.h / 2)