Destroy labels that are no longer used

This commit is contained in:
Manuel Vögele
2022-02-01 02:58:55 +01:00
parent 10633e4e2a
commit 39f9204fa7
+1 -1
View File
@@ -116,7 +116,7 @@ export function extendRuler() {
}
dragRulerRemovePathfindingWaypoints() {
this.waypoints.filter(waypoint => waypoint.isPathfinding).forEach(_ => this.labels.removeChild(this.labels.children.pop()));
this.waypoints.filter(waypoint => waypoint.isPathfinding).forEach(_ => this.labels.removeChild(this.labels.children[this.labels.children.length - 1]).destroy());
this.waypoints = this.waypoints.filter(waypoint => !waypoint.isPathfinding);
}