From 51c6871224497eb2255d57610b7a968206927fc0 Mon Sep 17 00:00:00 2001 From: Michael Enion Date: Thu, 11 Jul 2024 15:59:18 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix|Elevation|Don't=20double-lab?= =?UTF-8?q?el=20elevation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/segments.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/segments.js b/scripts/segments.js index 8191414..6e3570b 100644 --- a/scripts/segments.js +++ b/scripts/segments.js @@ -179,6 +179,11 @@ export function _getSegmentLabel(wrapped, segment, totalDistance) { const levelName = levelNameAtElevation(CONFIG.GeometryLib.utils.pixelsToGridUnits(segment.ray.B.z)); if ( levelName ) elevLabel += `\n${levelName}`; + if ( CONFIG[MODULE_ID].debug ) { + if ( totalDistance > 30 ) { console.debug("_getSegmentLabel: 30", segment, this); } + else if ( totalDistance > 60 ) { console.debug("_getSegmentLabel: 30", segment, this); } + } + let moveLabel = ""; const units = (canvas.scene.grid.units) ? ` ${canvas.scene.grid.units}` : ""; if ( segment.waypointDistance !== segment.waypointMoveDistance ) { @@ -401,7 +406,7 @@ function segmentElevationLabel(s) { const units = canvas.scene.grid.units; const increment = s.waypointElevationIncrement; const multiple = Settings.get(Settings.KEYS.TOKEN_RULER.ROUND_TO_MULTIPLE) || 1; - const elevation = CONFIG.GeometryLib.utils.pixelsToGridUnits(s.ray.B.z).toNearest(multiple); + const elevation = (CONFIG.GeometryLib.utils.pixelsToGridUnits(s.ray.A.z) + s.waypointElevationIncrement).toNearest(multiple); const segmentArrow = (increment > 0) ? "↑" : (increment < 0) ? "↓" : "↕";