🐛 GCV: Moves may be arcs too

Closes #4471
This commit is contained in:
Gina Häußge committed 2022-03-22 17:09:21 +01:00
1 parent 635d6179e3
commit 34e935bd0b
1 file changed
+8 -1
@@ -1042,7 +1042,14 @@ GCODE.renderer = (function () {
if (renderOptions["showMoves"] && !isNotCurrentLayer) {
// move => draw line from (prevX, prevY) to (x, y) in move color
ctx.lineWidth = lineWidthFactor;
ctx.lineTo(x, y);
if (cmd.direction !== undefined && cmd.direction !== 0) {
var arc = getArcParams(cmd);
var ccw = cmd.direction < 0; // Y-axis is inverted so direction is also inverted
ctx.arc(arc.x, arc.y, arc.r, arc.startAngle, arc.endAngle, ccw);
} else {
ctx.lineTo(x, y);
}
}
} else if (cmd.extrude) {
if (cmd.retract == 0) {