diff options
author | brenda-br | 2023-02-12 17:59:35 +0530 |
---|---|---|
committer | brenda-br | 2023-02-12 17:59:35 +0530 |
commit | ef7ea4c100e23b4e1ef19d64fc144ea39531d25d (patch) | |
tree | 5fdf9aec5ac436232fb17e2776ea357a347b4c26 | |
parent | e2a3e90d7b48196d7efee5330e60298f3270356e (diff) | |
download | Chemical-PFD-ef7ea4c100e23b4e1ef19d64fc144ea39531d25d.tar.gz Chemical-PFD-ef7ea4c100e23b4e1ef19d64fc144ea39531d25d.tar.bz2 Chemical-PFD-ef7ea4c100e23b4e1ef19d64fc144ea39531d25d.zip |
Fix #30 Node Line not connecting to its Node Item
-rw-r--r-- | src/main/python/shapes/shapes.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/main/python/shapes/shapes.py b/src/main/python/shapes/shapes.py index 5876f6e..8225a12 100644 --- a/src/main/python/shapes/shapes.py +++ b/src/main/python/shapes/shapes.py @@ -396,12 +396,13 @@ class LineGripItem(QGraphicsPathItem): self.tempLine.endGap = gap self.tempLine.setStartGripItem(self) self.tempLine.setEndGripItem(item) - # update line with end point so it sets final path - self.tempLine.updateLine(endPoint=endPoint) - self.lines.append(self.tempLine) - item.lines.append(self.tempLine) - tag = 1 - break + if self.tempLine.startGripItem.parentItem() != self.tempLine.endGripItem.parentItem(): + # update line with end point so it sets final path + self.tempLine.updateLine(endPoint=endPoint) + self.lines.append(self.tempLine) + item.lines.append(self.tempLine) + tag = 1 + break # end point on line elif type(item) == Line and item != self.tempLine: self.tempLine.setStartGripItem(self) |