Fix regression introduced in 6e745820 that made colors flicker during measurement

This commit is contained in:
Manuel Vögele
2021-03-10 11:50:55 +01:00
parent 0a7d8495c6
commit 0b71504da3
2 changed files with 5 additions and 1 deletions
+4
View File
@@ -1,3 +1,7 @@
## In development
### Bugfixes
- Fixed a regression where spaces could suddenly change their color during measurement
## 1.3.4 ## 1.3.4
### Module compatibility ### Module compatibility
- Increased compatiblility with other modules (namely Drag Ruler and Terrain Ruler are no longer incompatible) - Increased compatiblility with other modules (namely Drag Ruler and Terrain Ruler are no longer incompatible)
+1 -1
View File
@@ -211,7 +211,7 @@ export function highlightMeasurementNative(ray, startDistance) {
let {x, y} = ray.project(th); let {x, y} = ray.project(th);
let [x1h, y1h] = canvas.grid.grid.getGridPositionFromPixels(x, y); let [x1h, y1h] = canvas.grid.grid.getGridPositionFromPixels(x, y);
let [xgh, ygh] = canvas.grid.grid.getPixelsFromGridPosition(x1h, y1h); 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) color = dragRuler.getColorForDistance.call(this, startDistance, subDistance)
canvas.grid.highlightPosition(this.name, {x: xgh, y: ygh, color: color}); canvas.grid.highlightPosition(this.name, {x: xgh, y: ygh, color: color});
} }