diff --git a/croppa/main.py b/croppa/main.py index 86fbfad..299bbe1 100644 --- a/croppa/main.py +++ b/croppa/main.py @@ -2033,14 +2033,14 @@ class VideoEditor: prev_result = self._get_previous_tracking_point() next_result = self._get_next_tracking_point() - # Draw motion path - either previous→next OR previous→current + # Draw motion path - either previous→current OR previous→next line_to_draw = None - if prev_result and next_result: - # Draw previous→next line - line_to_draw = ("prev_next", prev_result, next_result) - elif prev_result and self.current_frame in self.tracking_points: - # Draw previous→current line + if prev_result and self.current_frame in self.tracking_points: + # Draw previous→current line (we're on a frame with tracking points) line_to_draw = ("prev_current", prev_result, (self.current_frame, self.tracking_points[self.current_frame])) + elif prev_result and next_result: + # Draw previous→next line (we're between frames) + line_to_draw = ("prev_next", prev_result, next_result) if line_to_draw: line_type, (frame1, pts1), (frame2, pts2) = line_to_draw @@ -2209,16 +2209,16 @@ class VideoEditor: print(f"DEBUG: Line snapping - prev_result: {prev_result}, next_result: {next_result}") - # Determine which line to check: previous→next OR previous→current + # Determine which line to check: previous→current OR previous→next line_to_check = None - if prev_result and next_result: - # Check previous→next line - line_to_check = ("prev_next", prev_result, next_result) - print(f"DEBUG: Checking prev→next line") - elif prev_result and self.current_frame in self.tracking_points: - # Check previous→current line + if prev_result and self.current_frame in self.tracking_points: + # Check previous→current line (we're on a frame with tracking points) line_to_check = ("prev_current", prev_result, (self.current_frame, self.tracking_points[self.current_frame])) - print(f"DEBUG: Checking prev→current line") + print(f"DEBUG: Checking prev->current line") + elif prev_result and next_result: + # Check previous→next line (we're between frames) + line_to_check = ("prev_next", prev_result, next_result) + print(f"DEBUG: Checking prev->next line") if line_to_check: line_type, (frame1, pts1), (frame2, pts2) = line_to_check