From 5a7f5531f20381b09c8f0a2d166b9718361d1772 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20V=C3=B6gele?= Date: Tue, 9 Mar 2021 14:47:53 +0100 Subject: [PATCH] When multiple colors overlap on one square draw the one representing the furthest range with the highest priority --- CHANGELOG.md | 1 + src/foundry_imports.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1747ade..ce48e81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ### New features - If the [Terrain Ruler module](https://foundryvtt.com/packages/terrain-ruler/) is installed and activated, Drag Ruler will now take difficult terrain that was placed with the [TerrainLayer module](https://foundryvtt.com/packages/TerrainLayer/) into account. - 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.4 ### Module compatibility diff --git a/src/foundry_imports.js b/src/foundry_imports.js index 3da2713..e0cdd35 100644 --- a/src/foundry_imports.js +++ b/src/foundry_imports.js @@ -157,7 +157,7 @@ export function measure(destination, {gridSpaces=true, snap=false} = {}) { rulerColor = getColorForDistance.call(this, totalDistance) else rulerColor = this.color - for (const [s, cs] of zip(segments, centeredSegments)) { + for (const [s, cs] of zip(segments.reverse(), centeredSegments.reverse())) { const { ray, label, text, last } = s; // Draw line segment