Fix snapping for tokens that are smaller than 1x1 (fixes #48)
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
## 1.4.4
|
||||||
|
### Bugfixes
|
||||||
|
- Fix snapping for tokens that are smaller than 1x1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## 1.4.3
|
## 1.4.3
|
||||||
### System compatibility
|
### System compatibility
|
||||||
- Drag Ruler's Generic SpeedProvider is now aware of good default values for the Savage Worlds Adventure Edition game system
|
- Drag Ruler's Generic SpeedProvider is now aware of good default values for the Savage Worlds Adventure Edition game system
|
||||||
|
|||||||
+1
-1
@@ -16,7 +16,7 @@ export function getSnapPointForToken(x, y, token) {
|
|||||||
return new PIXI.Point(...canvas.grid.getCenter(x, y))
|
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))
|
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)
|
const [snappedX, snappedY] = canvas.grid.getCenter(x - canvas.grid.w / 2, y - canvas.grid.h / 2)
|
||||||
|
|||||||
Reference in New Issue
Block a user