diff --git a/napari_animation/frame_sequence.py b/napari_animation/frame_sequence.py index 46af128..aae1bee 100644 --- a/napari_animation/frame_sequence.py +++ b/napari_animation/frame_sequence.py @@ -69,8 +69,12 @@ def __init__(self, key_frames: KeyFrameList, cache_size: int = 10) -> None: super().__init__() self._key_frames = key_frames key_frames.events.inserted.connect(self._rebuild_keyframe_index) - key_frames.events.removed.connect(self._rebuild_keyframe_index) - key_frames.events.changed.connect(self._rebuild_keyframe_index) + key_frames.events.removed.connect( + self._rebuild_keyframe_index, position="first" + ) + key_frames.events.changed.connect( + self._rebuild_keyframe_index, position="first" + ) key_frames.events.reordered.connect(self._rebuild_keyframe_index) self.__current_index = 0