From ef7ea4c100e23b4e1ef19d64fc144ea39531d25d Mon Sep 17 00:00:00 2001 From: brenda-br Date: Sun, 12 Feb 2023 17:59:35 +0530 Subject: Fix #30 Node Line not connecting to its Node Item --- src/main/python/shapes/shapes.py | 13 +++++++------ 1 file 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) -- cgit