Skip to content

Commit 22eb226

Browse files
committed
Fix index error due to missing previously selected shapes in current image
1 parent e6fd024 commit 22eb226

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

labelme/widgets/canvas.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -988,7 +988,11 @@ def keyReleaseEvent(self, ev):
988988
if int(modifiers) == 0:
989989
self.snapping = True
990990
elif self.editing():
991-
if self.movingShape and self.selectedShapes:
991+
if (
992+
self.movingShape
993+
and self.selectedShapes
994+
and self.selectedShapes[0] in self.shapes
995+
):
992996
index = self.shapes.index(self.selectedShapes[0])
993997
if self.shapesBackups[-1][index].points != self.shapes[index].points:
994998
self.storeShapes()

0 commit comments

Comments
 (0)