diff --git a/labelme/app.py b/labelme/app.py index 8ef10358a..207a769cf 100644 --- a/labelme/app.py +++ b/labelme/app.py @@ -1471,10 +1471,8 @@ def format_shape(s): return False def duplicateSelectedShape(self): - added_shapes = self.canvas.duplicateSelectedShapes() - for shape in added_shapes: - self.addLabel(shape) - self.setDirty() + self.copySelectedShape() + self.pasteSelectedShape() def pasteSelectedShape(self): self.loadShapes(self._copied_shapes, replace=False) diff --git a/labelme/widgets/canvas.py b/labelme/widgets/canvas.py index b243d107a..d71a6125b 100644 --- a/labelme/widgets/canvas.py +++ b/labelme/widgets/canvas.py @@ -666,12 +666,6 @@ def deleteShape(self, shape): self.storeShapes() self.update() - def duplicateSelectedShapes(self): - if self.selectedShapes: - self.selectedShapesCopy = [s.copy() for s in self.selectedShapes] - self.endMove(copy=True) - return self.selectedShapes - def paintEvent(self, event): if not self.pixmap: return super(Canvas, self).paintEvent(event)