Skip to content

Commit

Permalink
update backend init
Browse files Browse the repository at this point in the history
  • Loading branch information
7174Andy committed Dec 19, 2024
1 parent c5b3ef2 commit 38871a3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sleap/gui/widgets/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -2143,8 +2143,11 @@ def _duplicate_instance(self, event):

# Add instance to the context
context = self.player.context
current_frame = self.instance.frame
current_frame = self.player.state["labeled_frame"]
if context:
context.labels.labeled_frames.insert(
self.player.state["frame_idx"], new_instance
)
context.labels.add_instance(current_frame, new_instance)

# Create a new QtInstance object for the new instance
Expand All @@ -2156,6 +2159,7 @@ def _duplicate_instance(self, event):
show_non_visible=self.show_non_visible,
)
scene.addItem(new_instance_gui)
self.player.update_plot()

# Select the duplicated QtInstance object
new_instance_gui.setFlag(QGraphicsItem.ItemIsMovable)
Expand Down

0 comments on commit 38871a3

Please sign in to comment.