Skip to content

Commit

Permalink
CTRL + Click to create point (click just highlights)
Browse files Browse the repository at this point in the history
  • Loading branch information
wkentaro committed Sep 12, 2024
1 parent ecc83c2 commit c88edf6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions labelme/widgets/canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ def mouseMoveEvent(self, ev):
self.prevhShape = self.hShape = shape
self.prevhEdge = self.hEdge = index_edge
self.overrideCursor(CURSOR_POINT)
self.setToolTip(self.tr("Click to create point"))
self.setToolTip(self.tr("CTRL + Click to create point"))
self.setStatusTip(self.toolTip())
self.update()
break
Expand Down Expand Up @@ -466,7 +466,8 @@ def mousePressEvent(self, ev):
self.drawingPolygon.emit(True)
self.update()
elif self.editing():
if self.selectedEdge():
if self.selectedEdge() and int(ev.modifiers()) == QtCore.Qt.ControlModifier:
# Add point if: CTRL + Left-click on an edge
self.addPointToEdge()
elif (
self.selectedVertex()
Expand Down

0 comments on commit c88edf6

Please sign in to comment.