Skip to content

Commit

Permalink
Make duplicateSelectedShape use copySelectedShape and pasteSelectedShape
Browse files Browse the repository at this point in the history
  • Loading branch information
wkentaro committed Sep 20, 2024
1 parent 242563a commit b9c83ff
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
6 changes: 2 additions & 4 deletions labelme/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 0 additions & 6 deletions labelme/widgets/canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b9c83ff

Please sign in to comment.