summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/python/shapes/line.py6
-rw-r--r--src/main/python/shapes/shapes.py5
2 files changed, 6 insertions, 5 deletions
diff --git a/src/main/python/shapes/line.py b/src/main/python/shapes/line.py
index 268b750..0e56009 100644
--- a/src/main/python/shapes/line.py
+++ b/src/main/python/shapes/line.py
@@ -809,6 +809,12 @@ class Line(QGraphicsPathItem):
for line in self.midLines:
if line.scene():
line.scene().removeItem(line)
+ if self.startGripItem and self.startGripItem.line and not self.startGripItem.tempLine:
+ self.startGripItem.line = None
+ if self.endGripItem and self.endGripItem.line:
+ self.endGripItem.line = None
+ if self.refLine:
+ if self in self.refLine.midLines: self.refLine.midLines.remove(self)
return super(Line, self).itemChange(change, value)
diff --git a/src/main/python/shapes/shapes.py b/src/main/python/shapes/shapes.py
index fe92938..0358898 100644
--- a/src/main/python/shapes/shapes.py
+++ b/src/main/python/shapes/shapes.py
@@ -240,9 +240,6 @@ class LineGripItem(GripItem):
if mouseEvent.button() != Qt.LeftButton:
return
# initialize a line and add on scene
- if self.line and not self.line.scene():
- self.line = None
-
if not self.line:
startPoint = endPoint = self.parentItem().mapToScene(self.pos())
self.tempLine = Line(startPoint, endPoint)
@@ -277,8 +274,6 @@ class LineGripItem(GripItem):
items = self.scene().items(QPointF(mouseEvent.scenePos().x(), mouseEvent.scenePos().y()))
for item in items:
if type(item) == LineGripItem and item != self:
- if item.line and not item.line.scene():
- item.line = None
if item.line:
break
self.tempLine.setStartGripItem(self)