Skip to content

Commit

Permalink
Only propagate Transpose Tracks when propagate is checked (#1748)
Browse files Browse the repository at this point in the history
Fix always-propagate transpose tracks issue
  • Loading branch information
vaibhavtrip29 authored Apr 19, 2024
1 parent f0c44c0 commit 0134ab4
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion sleap/gui/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -2481,7 +2481,16 @@ def do_action(cls, context: CommandContext, params: dict):
# Swap tracks for current and subsequent frames when we have tracks
old_track, new_track = instances[0].track, instances[1].track
if old_track is not None and new_track is not None:
frame_range = (context.state["frame_idx"], context.state["video"].frames)
if context.state["propagate track labels"]:
frame_range = (
context.state["frame_idx"],
context.state["video"].frames,
)
else:
frame_range = (
context.state["frame_idx"],
context.state["frame_idx"] + 1,
)
context.labels.track_swap(
context.state["video"], new_track, old_track, frame_range
)
Expand Down

0 comments on commit 0134ab4

Please sign in to comment.