summaryrefslogtreecommitdiff
path: root/src/main/python/shapes/line.py
diff options
context:
space:
mode:
authorsumit2020-06-03 14:22:45 +0530
committersumit2020-06-03 14:22:45 +0530
commit1c5b2f668cd526dfcc0901124daef2dc041b447e (patch)
tree2161b480699cce1822e9cbfcf7d1d484774ef340 /src/main/python/shapes/line.py
parent6d002432a2234180e447114de67a522ad58372d3 (diff)
parent7980ef69a7c4b3b02c5edd4ecb8c765c99d44d18 (diff)
downloadChemical-PFD-1c5b2f668cd526dfcc0901124daef2dc041b447e.tar.gz
Chemical-PFD-1c5b2f668cd526dfcc0901124daef2dc041b447e.tar.bz2
Chemical-PFD-1c5b2f668cd526dfcc0901124daef2dc041b447e.zip
Merge branch 'master' of https://github.com/Sumit-Sahu/Chemical-PFD
Diffstat (limited to 'src/main/python/shapes/line.py')
-rw-r--r--src/main/python/shapes/line.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/main/python/shapes/line.py b/src/main/python/shapes/line.py
index 1a54284..2d7eba8 100644
--- a/src/main/python/shapes/line.py
+++ b/src/main/python/shapes/line.py
@@ -199,12 +199,9 @@ class Line(QGraphicsPathItem):
path = QPainterPath(self.startPoint)
# iterating over all points of line
for i in range(len(self.points) - 1):
- # for point in self.commonPaths:
- # # point is center of common path
- # pass
- for point in self.commonPaths:
- x1, y1 = self.points[i].x(), self.points[i].y()
- x2, y2 = self.points[i+1].x(), self.points[i+1].y()
+ x1, y1 = self.points[i].x(), self.points[i].y()
+ x2, y2 = self.points[i+1].x(), self.points[i+1].y()
+ for point in self.commonPaths.sort(key = lambda x: x.x() + x.y(), reverse=x2<x1 or y2<y1):
x, y = point.x(), point.y()
# if not x1 * (y - y2) + x * (y2 - y1) + x2 * (y1 - y) :
if x == x1 == x2: