Skip to content

Commit

Permalink
fix(ui): Remove old paths if they vanish from the map data
Browse files Browse the repository at this point in the history
  • Loading branch information
Hypfer committed Mar 8, 2021
1 parent f4c4c1a commit eef055e
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions client/zone/js-modules/vacuum-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,26 @@ export function VacuumMap(canvasElement) {
newImg.src = svgPathDataUrl;
}
}
} else {
const emptySvgDataUrl = "data:image/svg+xml;charset=utf-8," + encodeURIComponent("<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"" + size.x + "\" height=\"" + size.y + "\" viewBox=\"0 0 " + size.x + " " + size.y + "\"></svg>");

if (isPredicted) {
let newImg = new Image();

newImg.onload = () => {
predictedPathSvg = newImg;
};

newImg.src = emptySvgDataUrl;
} else {
let newImg = new Image();

newImg.onload = () => {
pathSvg = newImg;
};

newImg.src = emptySvgDataUrl;
}
}
}

Expand Down

0 comments on commit eef055e

Please sign in to comment.