From 7a00d6fcc258c13fa02cad7a06c4338c39324672 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20V=C3=B6gele?= Date: Tue, 4 Oct 2022 21:32:26 +0200 Subject: [PATCH] Stop pathfinding if the measurement is canceled mid-pathfinding --- src/ruler.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ruler.js b/src/ruler.js index 6bbf9eb..302569f 100644 --- a/src/ruler.js +++ b/src/ruler.js @@ -338,6 +338,10 @@ export function extendRuler() { _endMeasurement() { super._endMeasurement(); this.draggedEntity = null; + if (this.pathfindingJob) { + routinglib.cancelPathfinding(this.pathfindingJob); + this.pathfindingJob = undefined; + } } // The functions below aren't present in the orignal Ruler class and are added by Drag Ruler