From c847ed9d13266608222a2dc8eb863d10ffa22113 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Thu, 22 Jun 2023 16:33:25 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Gcode=20viewer:=20reset=20some?= =?UTF-8?q?=20analysis=20outputs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We need to reset emptyLayers (and should - for the sake of consistency - also reset percentageByLayer) after running an analysis because otherwise old values will stay in there until page reload, causing layers to not render that actually are not empty but were in any previously loaded model. --- src/octoprint/plugins/gcodeviewer/static/js/viewer/worker.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/octoprint/plugins/gcodeviewer/static/js/viewer/worker.js b/src/octoprint/plugins/gcodeviewer/static/js/viewer/worker.js index 8c8c06de8..6acb249a2 100644 --- a/src/octoprint/plugins/gcodeviewer/static/js/viewer/worker.js +++ b/src/octoprint/plugins/gcodeviewer/static/js/viewer/worker.js @@ -914,6 +914,8 @@ var runAnalyze = function (message) { layerCnt = 0; speeds = {extrude: [], retract: [], move: []}; speedsByLayer = {extrude: {}, retract: {}, move: {}}; + emptyLayers = []; + percentageByLayer = []; }; var setOption = function (options) {