diff --git a/CHANGELOG.md b/CHANGELOG.md index ce48e81..0166bea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ - The GM's Drag Ruler can now be hidden from non GM players via a setting. - When multiple different colors apply to a single grid space because the path crosses itself the color representing ranges further away will take priortiy over colors representing closer ranges. + +## 1.3.5 +### Bugfixes +- Fixed a regression where spaces could suddenly change their color during measurement + + ## 1.3.4 ### Module compatibility - Increased compatiblility with other modules (namely Drag Ruler and Terrain Ruler are no longer incompatible) diff --git a/module.json b/module.json index 44b4bb3..99e7712 100644 --- a/module.json +++ b/module.json @@ -2,7 +2,7 @@ "name": "drag-ruler", "title": "Drag Ruler", "description": "When dragging a token displays a ruler showing how far you've moved that token.", - "version": "1.3.4", + "version": "1.3.5", "minimumCoreVersion" : "0.7.9", "compatibleCoreVersion" : "0.7.9", "authors": [ @@ -31,7 +31,7 @@ } ], "url": "https://github.com/manuelVo/foundryvtt-drag-ruler", - "download": "https://github.com/manuelVo/foundryvtt-drag-ruler/archive/v1.3.4.zip", + "download": "https://github.com/manuelVo/foundryvtt-drag-ruler/archive/v1.3.5.zip", "manifest": "https://raw.githubusercontent.com/manuelVo/foundryvtt-drag-ruler/master/module.json", "readme": "https://github.com/manuelVo/foundryvtt-drag-ruler/blob/master/README.md", "changelog": "https://github.com/manuelVo/foundryvtt-drag-ruler/blob/master/CHANGELOG.md", diff --git a/src/foundry_imports.js b/src/foundry_imports.js index e0cdd35..bdfe63a 100644 --- a/src/foundry_imports.js +++ b/src/foundry_imports.js @@ -222,7 +222,7 @@ export function highlightMeasurementNative(ray, startDistance) { let {x, y} = ray.project(th); let [x1h, y1h] = canvas.grid.grid.getGridPositionFromPixels(x, y); let [xgh, ygh] = canvas.grid.grid.getPixelsFromGridPosition(x1h, y1h); - subDistance = canvas.grid.measureDistances([{ray: new Ray(ray.A, {x: xg, y: yg})}], {gridSpaces: true})[0] + subDistance = canvas.grid.measureDistances([{ray: new Ray(ray.A, {x: xgh, y: ygh})}], {gridSpaces: true})[0] color = dragRuler.getColorForDistance.call(this, startDistance, subDistance) canvas.grid.highlightPosition(this.name, {x: xgh, y: ygh, color: color}); }