diff --git a/src/components/gcodeviewer/Viewer.vue b/src/components/gcodeviewer/Viewer.vue index 0fe27a4f..24c60a03 100644 --- a/src/components/gcodeviewer/Viewer.vue +++ b/src/components/gcodeviewer/Viewer.vue @@ -436,10 +436,23 @@ export default class Viewer extends Mixins(BaseMixin) { return this.$store.state.printer.print_stats?.filename ?? '' } - get currentPosition() { + get livePosition() { return this.$store.state.printer.motion_report?.live_position ?? [0, 0, 0, 0] } + get gcodeOffset() { + return this.$store.state.printer?.gcode_move?.homing_origin ?? [0, 0, 0] + } + + get currentPosition() { + return [ + this.livePosition[0] - this.gcodeOffset[0], + this.livePosition[1] - this.gcodeOffset[1], + this.livePosition[2] - this.gcodeOffset[2], + this.livePosition[3], + ] + } + get showTrackingButton() { return this.printerIsPrinting && this.sdCardFilePath === this.loadedFile }