diff --git a/labelme/widgets/canvas.py b/labelme/widgets/canvas.py index f383c3ea8..542d71668 100644 --- a/labelme/widgets/canvas.py +++ b/labelme/widgets/canvas.py @@ -988,7 +988,11 @@ def keyReleaseEvent(self, ev): if int(modifiers) == 0: self.snapping = True elif self.editing(): - if self.movingShape and self.selectedShapes: + if ( + self.movingShape + and self.selectedShapes + and self.selectedShapes[0] in self.shapes + ): index = self.shapes.index(self.selectedShapes[0]) if self.shapesBackups[-1][index].points != self.shapes[index].points: self.storeShapes()