From 0b71504da363556001c15b16269ffe6a881a3347 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20V=C3=B6gele?= Date: Wed, 10 Mar 2021 11:50:55 +0100 Subject: [PATCH] Fix regression introduced in 6e745820 that made colors flicker during measurement --- CHANGELOG.md | 4 ++++ src/foundry_imports.js | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e778466..e1e16a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## In development +### 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/src/foundry_imports.js b/src/foundry_imports.js index 940b176..be5f7df 100644 --- a/src/foundry_imports.js +++ b/src/foundry_imports.js @@ -211,7 +211,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}); }