From 534824eb17469aa7ce4ecc5b074dda070a166e81 Mon Sep 17 00:00:00 2001 From: Kestin Goforth Date: Mon, 1 Aug 2022 08:03:06 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20GCV:=20Fix=20rendering=20of=20G0?= =?UTF-8?q?2=20and=20G03=20(#4587)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix rendering for G02 and G03 commands * Improve performance of arc direction check --- .../plugins/gcodeviewer/static/js/viewer/worker.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/octoprint/plugins/gcodeviewer/static/js/viewer/worker.js b/src/octoprint/plugins/gcodeviewer/static/js/viewer/worker.js index c50d497af..3c2783fb7 100644 --- a/src/octoprint/plugins/gcodeviewer/static/js/viewer/worker.js +++ b/src/octoprint/plugins/gcodeviewer/static/js/viewer/worker.js @@ -480,8 +480,10 @@ var doParse = function () { center_j = Number(args[j].slice(1)); break; case "g": - if (args[j].charAt(1).toLowerCase() === "2") direction = -1; - if (args[j].charAt(1).toLowerCase() === "3") direction = 1; + if (args[j].charAt(1) === "2" || args[j].charAt(2) === "2") + direction = -1; + else if (args[j].charAt(1) === "3" || args[j].charAt(2) === "3") + direction = 1; break; } }