From 4785a99a6340b8e0d869530a4e0b4da7632c2d45 Mon Sep 17 00:00:00 2001 From: 2ManyProjects Date: Thu, 8 Jan 2026 22:11:07 -0600 Subject: [PATCH] xoffset fix --- src/stitching_scanner.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/stitching_scanner.py b/src/stitching_scanner.py index 3bd31e1..b7a1b1d 100644 --- a/src/stitching_scanner.py +++ b/src/stitching_scanner.py @@ -48,6 +48,8 @@ class StitchState: total_rows: int = 0 mosaic_width: int = 0 mosaic_height: int = 0 + mosaic_init_width: int = 0 + mosaic_init_height: int = 0 frame_count: int = 0 append_count: int = 0 @@ -148,6 +150,8 @@ class StitchingScanner: h, w = frame.shape[:2] self.state.mosaic_width = w self.state.mosaic_height = h + self.state.mosaic_init_width = w + self.state.mosaic_init_height = h self.state.frame_count = 1 self.state.append_count = 0 @@ -205,7 +209,7 @@ class StitchingScanner: h_strip, w_strip = strip.shape[:2] # Clamp x_offset to valid range - x_offset = max(0, w_base - 1) + x_offset = max(0, w_base - self.state.mosaic_init_width) # Create full-width strip with strip placed at x_offset full_strip = np.zeros((h_strip, w_base, 3), dtype=np.uint8)