diff --git a/croppa/main.py b/croppa/main.py index 299bbe1..75857fb 100644 --- a/croppa/main.py +++ b/croppa/main.py @@ -1076,9 +1076,14 @@ class VideoEditor: return current = self.current_frame candidates = [f for f in tracking_frames if f < current] - target = candidates[-1] if candidates else tracking_frames[-1] - print(f"DEBUG: Jump prev tracking from {current} -> {target}; tracking_frames={tracking_frames}") - self.seek_to_frame(target) + if candidates: + target = candidates[-1] + print(f"DEBUG: Jump prev tracking from {current} -> {target}; tracking_frames={tracking_frames}") + self.seek_to_frame(target) + else: + target = tracking_frames[0] + print(f"DEBUG: Jump prev tracking to first marker from {current} -> {target}; tracking_frames={tracking_frames}") + self.seek_to_frame(target) def jump_to_next_marker(self): """Jump to the next tracking marker (frame with tracking points).""" @@ -1095,8 +1100,9 @@ class VideoEditor: print(f"DEBUG: Jump next tracking from {current} -> {f}; tracking_frames={tracking_frames}") self.seek_to_frame(f) return - print(f"DEBUG: Jump next tracking wrap from {current} -> {tracking_frames[0]}; tracking_frames={tracking_frames}") - self.seek_to_frame(tracking_frames[0]) + target = tracking_frames[-1] + print(f"DEBUG: Jump next tracking to last marker from {current} -> {target}; tracking_frames={tracking_frames}") + self.seek_to_frame(target) def _get_previous_tracking_point(self): """Get the tracking point from the previous frame that has tracking points.""" diff --git a/croppa/spec.md b/croppa/spec.md index f28663f..3063de4 100644 --- a/croppa/spec.md +++ b/croppa/spec.md @@ -68,8 +68,8 @@ Be careful to save and load settings when navigating this way - **Display** Points are rendered as blue dots per frame, in addition the previous tracking point (red) and next tracking point (magenta) are shown with yellow arrows indicating motion direction #### Motion Tracking Navigation -- **,**: Jump to previous tracking marker (previous frame that has one or more tracking points). Wrap-around supported. -- **.**: Jump to next tracking marker (next frame that has one or more tracking points). Wrap-around supported. +- **,**: Jump to previous tracking marker (previous frame that has one or more tracking points). Goes to first marker if at beginning. +- **.**: Jump to next tracking marker (next frame that has one or more tracking points). Goes to last marker if at end. ### Markers and Looping - **1**: Set cut start marker at current frame