Skip to content

Commit

Permalink
Temporarily fixed ValueError by adding a check for selected shape exi…
Browse files Browse the repository at this point in the history
…stence in the shapes list (#388)
  • Loading branch information
CVHub520 committed May 8, 2024
1 parent 755c578 commit dca185a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion anylabeling/views/labeling/widgets/canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -1499,9 +1499,12 @@ def keyReleaseEvent(self, ev):
if int(modifiers) == 0:
self.snapping = True
elif self.editing():
# NOTE: Temporary fix to avoid ValueError
# when the selected shape is not in the shapes list
if (
self.moving_shape or self.rotating_shape
) and self.selected_shapes:
) and self.selected_shapes \
and self.selected_shapes[0] in self.shapes:
index = self.shapes.index(self.selected_shapes[0])
if (
self.shapes_backups[-1][index].points
Expand Down

0 comments on commit dca185a

Please sign in to comment.