提交 7189f2c9 编写于 作者: H Henrik Toft 提交者: Kentaro Wada

Adding ability to add or remove points from existing polygon when...

Adding ability to add or remove points from existing polygon when left-clicking while holding down the SHIFT-key.
上级 4e46e00f
......@@ -376,6 +376,19 @@ class Canvas(QtWidgets.QWidget):
self.repaint()
elif ev.button() == QtCore.Qt.LeftButton and self.selectedShapes:
self.overrideCursor(CURSOR_GRAB)
if (
self.editing()
and int(ev.modifiers()) == QtCore.Qt.ShiftModifier
):
# Add point to line if: left-click + SHIFT on a line segment
self.addPointToEdge()
elif ev.button() == QtCore.Qt.LeftButton and self.selectedVertex():
if (
self.editing()
and int(ev.modifiers()) == QtCore.Qt.ShiftModifier
):
# Delete point if: left-click + SHIFT on a point
self.removeSelectedPoint()
if self.movingShape and self.hShape:
index = self.shapes.index(self.hShape)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册