We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 639414b commit 8a6b082Copy full SHA for 8a6b082
src/store/gcodePreview/getters.ts
@@ -120,10 +120,23 @@ export const getters = {
120
z: NaN
121
}
122
123
- for (let i = moveIndex; i >= 0 && (Number.isNaN(output.x) || Number.isNaN(output.y) || Number.isNaN(output.z)); i--) {
+ for (let i = moveIndex, count = 0; i >= 0 && count < 3; i--) {
124
const move = moves[i]
125
126
- Object.assign(output, move)
+ if (Number.isNaN(output.x) && move.x != null) {
127
+ output.x = move.x
128
+ count++
129
+ }
130
+
131
+ if (Number.isNaN(output.y) && move.y != null) {
132
+ output.y = move.y
133
134
135
136
+ if (Number.isNaN(output.z) && move.z != null) {
137
+ output.z = move.z
138
139
140
141
142
return {
0 commit comments