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; } }