Skip to content

Commit

Permalink
Attempted fix for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
multimeric committed Nov 12, 2024
1 parent 5d6f68f commit b8d4440
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion plugin/napari_lattice/shape_selector.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,12 @@ def _on_selection_change(self, event: Event) -> None:
source: Shapes = event.source
selection: list[Shape] = []
for index in source.selected_data:
selection.append(Shape(layer=source, index=index))
shape = Shape(layer=source, index=index)
if shape not in self.shapes.choices:
# If we ever encounter a shape that isn't a legal choice, we have to terminate to avoid an error
# This seems to happen on Windows only due to the order of events firing
return
selection.append(shape)
self.shapes.value = selection

def _connect_shapes(self, shapes: Shapes) -> None:
Expand Down

0 comments on commit b8d4440

Please sign in to comment.