From c88edf6b3bc0623090a7f870ca0bee1eddc6c4a7 Mon Sep 17 00:00:00 2001 From: Kentaro Wada Date: Thu, 12 Sep 2024 17:36:29 +0900 Subject: [PATCH] CTRL + Click to create point (click just highlights) --- labelme/widgets/canvas.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/labelme/widgets/canvas.py b/labelme/widgets/canvas.py index a78f073d3..a63a9f21e 100644 --- a/labelme/widgets/canvas.py +++ b/labelme/widgets/canvas.py @@ -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 @@ -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()