From 8caa578608e70f72f0c81c0c7ad150ed908eabfa Mon Sep 17 00:00:00 2001 From: 2ManyProjects Date: Thu, 8 Jan 2026 01:55:33 -0600 Subject: [PATCH] better w calc --- src/stitching_scanner.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/stitching_scanner.py b/src/stitching_scanner.py index 82ffa1a..991ac46 100644 --- a/src/stitching_scanner.py +++ b/src/stitching_scanner.py @@ -501,11 +501,6 @@ class StitchingScanner: no_movement_count = 0 max_no_movement = 50 stop_reason = 'stopped' - if direction == ScanDirection.RIGHT: - self.state.current_x = 0 - elif direction == ScanDirection.LEFT: - self.state.current_x = self.state.mosaic_width - w # At right edge - self.log(f"Current X offset ({self.state.current_x}px)") while self.running and not self.paused: if time.time() - start_time > self.config.max_scan_time: @@ -520,6 +515,11 @@ class StitchingScanner: if abs(total_x) >= self.config.max_mosaic_width: self.log(f"Max dimension reached ({self.config.max_mosaic_width}px)") + if direction == ScanDirection.RIGHT: + self.state.current_x = self.state.max_mosaic_width - w # At right edge + elif direction == ScanDirection.LEFT: + self.state.current_x = 0 + self.log(f"Current X offset ({self.state.current_x}px)") stop_reason = 'max_dim' break # Pulse motor