Compare commits

..

2 Commits

Author SHA1 Message Date
Manuel Vögele 0aee541eb3 Release v1.4.2 2021-03-18 07:45:18 +01:00
Manuel Vögele 40dde08ddd Allow getTokenShape on gridless maps (fixes #44) 2021-03-18 07:41:30 +01:00
3 changed files with 10 additions and 5 deletions
+4
View File
@@ -1,3 +1,7 @@
## 1.4.2
### Bugfixes
- Drag Ruler now works again on gridless maps
## 1.4.1 ## 1.4.1
### Bugfixes ### Bugfixes
- Fixed a bug where Drag Ruler wouldn't work at all on hex grids when the Hex Token Size Support isn't installed - Fixed a bug where Drag Ruler wouldn't work at all on hex grids when the Hex Token Size Support isn't installed
+2 -2
View File
@@ -2,7 +2,7 @@
"name": "drag-ruler", "name": "drag-ruler",
"title": "Drag Ruler", "title": "Drag Ruler",
"description": "When dragging a token displays a ruler showing how far you've moved that token.", "description": "When dragging a token displays a ruler showing how far you've moved that token.",
"version": "1.4.1", "version": "1.4.2",
"minimumCoreVersion" : "0.7.9", "minimumCoreVersion" : "0.7.9",
"compatibleCoreVersion" : "0.7.9", "compatibleCoreVersion" : "0.7.9",
"authors": [ "authors": [
@@ -36,7 +36,7 @@
} }
], ],
"url": "https://github.com/manuelVo/foundryvtt-drag-ruler", "url": "https://github.com/manuelVo/foundryvtt-drag-ruler",
"download": "https://github.com/manuelVo/foundryvtt-drag-ruler/archive/v1.4.1.zip", "download": "https://github.com/manuelVo/foundryvtt-drag-ruler/archive/v1.4.2.zip",
"manifest": "https://raw.githubusercontent.com/manuelVo/foundryvtt-drag-ruler/master/module.json", "manifest": "https://raw.githubusercontent.com/manuelVo/foundryvtt-drag-ruler/master/module.json",
"readme": "https://github.com/manuelVo/foundryvtt-drag-ruler/blob/master/README.md", "readme": "https://github.com/manuelVo/foundryvtt-drag-ruler/blob/master/README.md",
"changelog": "https://github.com/manuelVo/foundryvtt-drag-ruler/blob/master/CHANGELOG.md", "changelog": "https://github.com/manuelVo/foundryvtt-drag-ruler/blob/master/CHANGELOG.md",
+4 -3
View File
@@ -57,9 +57,10 @@ export function getAreaFromPositionAndShape(position, shape) {
} }
export function getTokenShape(token) { export function getTokenShape(token) {
if (token.scene.data.gridType === CONST.GRID_TYPES.GRIDLESS) if (token.scene.data.gridType === CONST.GRID_TYPES.GRIDLESS) {
throw new Error("getTokenShape cannot be called for tokens on gridless maps") return [{x: 0, y: 0}]
if (token.scene.data.gridType === CONST.GRID_TYPES.SQUARE) { }
else if (token.scene.data.gridType === CONST.GRID_TYPES.SQUARE) {
const topOffset = -Math.floor(token.data.height / 2) const topOffset = -Math.floor(token.data.height / 2)
const leftOffset = -Math.floor(token.data.width / 2) const leftOffset = -Math.floor(token.data.width / 2)
const shape = [] const shape = []