Skip to content

Commit 175312f

Browse files
committed
fix: typo in check
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
1 parent ca8db3f commit 175312f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/store/gcodePreview/getters.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const getters = {
3030
zStart = index
3131
}
3232

33-
if (move.e && move.e > 0 && (Number.isNaN(zLast) || z < zLast || z >= zNext)) {
33+
if (move.e != null && move.e > 0 && (Number.isNaN(zLast) || z < zLast || z >= zNext)) {
3434
if (['x', 'y', 'i', 'j'].some(x => isKeyOf(x, move) && move[x] !== 0)) {
3535
zLast = z
3636
zNext = Math.round((z + minLayerHeight) * 10000) / 10000
@@ -120,7 +120,7 @@ export const getters = {
120120
z: NaN
121121
}
122122

123-
for (let i = moveIndex; i >= 0 && (Number.isNaN(output.x) || Number.isNaN(output.y) || Number.isNaN(output.y)); i--) {
123+
for (let i = moveIndex; i >= 0 && (Number.isNaN(output.x) || Number.isNaN(output.y) || Number.isNaN(output.z)); i--) {
124124
const move = moves[i]
125125

126126
Object.assign(output, move)
@@ -230,7 +230,6 @@ export const getters = {
230230
}
231231

232232
path.extrusions[path.tool] += moveToSVGPath(toolhead, move)
233-
Object.assign(toolhead, move)
234233
} else {
235234
if (!traveling) {
236235
path.moves += `M${toolhead.x},${toolhead.y}`
@@ -245,8 +244,9 @@ export const getters = {
245244
}
246245

247246
path.moves += moveToSVGPath(toolhead, move)
248-
Object.assign(toolhead, move)
249247
}
248+
249+
Object.assign(toolhead, move)
250250
}
251251

252252
path.toolhead = {

0 commit comments

Comments
 (0)