Skip to content

Commit

Permalink
fix: improve gcode viewer sync on layer changes
Browse files Browse the repository at this point in the history
Signed-off-by: Kieran Eglin <[email protected]>
  • Loading branch information
kieraneglin authored and cadriel committed Jun 28, 2021
1 parent a7416ee commit 7a7484d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/widgets/gcode-preview/GcodePreviewCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,13 @@ export default class GcodePreviewCard extends Mixins(StateMixin, FilesMixin) {
if (this.followProgress) {
const fileMovePosition = this.$store.getters['gcodePreview/getMoveIndexByFilePosition'](this.filePosition)
// In some (yet unclear) cases, fileMovePosition can get out of sync with
// the component's notion of moveProgress. This seems to happen during
// layer changes, but not every time. Possibly some gcode command is getting
// misinterpreted.
// This "fix" simply forces a re-sync of progress if they get out of sync
if (fileMovePosition !== this.moveProgress) {
this.followProgress = false
this.syncMoveProgress()
}
}
}
Expand Down

0 comments on commit 7a7484d

Please sign in to comment.