Remove redundant & broken code path in _computeDistance (fixes #280)

This commit is contained in:
Manuel Vögele
2023-06-12 21:39:50 +02:00
parent 844df150a6
commit 8101381cc4
+1 -7
View File
@@ -262,12 +262,6 @@ export function extendRuler() {
if (!this.isDragRuler) { if (!this.isDragRuler) {
return super._computeDistance(gridSpaces); return super._computeDistance(gridSpaces);
} }
if (!this.dragRulerEnableTerrainRuler) {
if (!this.dragRulerIgnoreGrid) {
gridSpaces = true;
}
super._computeDistance(gridSpaces);
} else {
const shape = this.draggedEntity ? getTokenShape(this.draggedEntity) : null; const shape = this.draggedEntity ? getTokenShape(this.draggedEntity) : null;
const options = { const options = {
ignoreGrid: this.dragRulerIgnoreGrid, ignoreGrid: this.dragRulerIgnoreGrid,
@@ -284,7 +278,7 @@ export function extendRuler() {
s.distance = d; s.distance = d;
s.text = this._getSegmentLabel(s, totalDistance); s.text = this._getSegmentLabel(s, totalDistance);
} }
}
for (const [i, segment] of this.segments.entries()) { for (const [i, segment] of this.segments.entries()) {
const unsnappedSegment = this.dragRulerUnsnappedSegments[i]; const unsnappedSegment = this.dragRulerUnsnappedSegments[i];
unsnappedSegment.startDistance = segment.startDistance; unsnappedSegment.startDistance = segment.startDistance;