diff --git a/labelme/widgets/canvas.py b/labelme/widgets/canvas.py index a78f073d3..0bdab1ea7 100644 --- a/labelme/widgets/canvas.py +++ b/labelme/widgets/canvas.py @@ -342,7 +342,12 @@ def mouseMoveEvent(self, ev): self.hEdge = None shape.highlightVertex(index, shape.MOVE_VERTEX) self.overrideCursor(CURSOR_POINT) - self.setToolTip(self.tr("Click & drag to move point")) + self.setToolTip( + self.tr( + "Click & Drag to move point\n" + "ALT + SHIFT + Click to delete point" + ) + ) self.setStatusTip(self.toolTip()) self.update() break @@ -354,7 +359,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("ALT + Click to create point")) self.setStatusTip(self.toolTip()) self.update() break @@ -466,13 +471,11 @@ def mousePressEvent(self, ev): self.drawingPolygon.emit(True) self.update() elif self.editing(): - if self.selectedEdge(): + if self.selectedEdge() and ev.modifiers() == QtCore.Qt.AltModifier: self.addPointToEdge() - elif ( - self.selectedVertex() - and int(ev.modifiers()) == QtCore.Qt.ShiftModifier + elif self.selectedVertex() and ev.modifiers() == ( + QtCore.Qt.AltModifier | QtCore.Qt.ShiftModifier ): - # Delete point if: left-click + SHIFT on a point self.removeSelectedPoint() group_mode = int(ev.modifiers()) == QtCore.Qt.ControlModifier