diff options
author | sumit | 2020-06-05 06:59:24 +0530 |
---|---|---|
committer | sumit | 2020-06-05 06:59:24 +0530 |
commit | 37a4ded8e5b139a1cb150a8164bc5552e988a1c4 (patch) | |
tree | dc5a4d9132878870193832bcef102037db131c48 /src/main/python/shapes | |
parent | 4c2133fdff296922fe6fc1a03462d8258564bd82 (diff) | |
parent | 01e0a1e191a550ad1cbed717d768a9257d10f462 (diff) | |
download | Chemical-PFD-37a4ded8e5b139a1cb150a8164bc5552e988a1c4.tar.gz Chemical-PFD-37a4ded8e5b139a1cb150a8164bc5552e988a1c4.tar.bz2 Chemical-PFD-37a4ded8e5b139a1cb150a8164bc5552e988a1c4.zip |
Merge branch 'master' of https://github.com/Sumit-Sahu/Chemical-PFD
Diffstat (limited to 'src/main/python/shapes')
-rw-r--r-- | src/main/python/shapes/line.py | 2 | ||||
-rw-r--r-- | src/main/python/shapes/shapes.py | 6 |
2 files changed, 3 insertions, 5 deletions
diff --git a/src/main/python/shapes/line.py b/src/main/python/shapes/line.py index 2d7eba8..f5eb92a 100644 --- a/src/main/python/shapes/line.py +++ b/src/main/python/shapes/line.py @@ -201,7 +201,7 @@ class Line(QGraphicsPathItem): for i in range(len(self.points) - 1): 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): + for point in sorted(self.commonPaths, 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: diff --git a/src/main/python/shapes/shapes.py b/src/main/python/shapes/shapes.py index 94b9eb1..47d9a52 100644 --- a/src/main/python/shapes/shapes.py +++ b/src/main/python/shapes/shapes.py @@ -9,11 +9,10 @@ from PyQt5.QtWidgets import (QGraphicsColorizeEffect, QGraphicsEllipseItem, QGraphicsProxyWidget, QGraphicsSceneHoverEvent, QLineEdit) -from utils.app import fileImporter - from .line import Line from utils.app import fileImporter +from utils.app import fileImporter class GripItem(QGraphicsPathItem): """ @@ -213,7 +212,6 @@ class LineGripItem(GripItem): # initialize a line and add on scene startPoint = endPoint = self.parentItem().mapToScene(self.pos()) self.tempLine = Line(startPoint, endPoint) - self.tempLine.setStartGripItem(self) self.scene().addItemPlus(self.tempLine) super().mousePressEvent(mouseEvent) @@ -289,7 +287,7 @@ class NodeItem(QGraphicsSvgItem): def __init__(self, unitOperationType, parent=None): QGraphicsSvgItem.__init__(self, parent) self.m_type = unitOperationType - self.id =None + self.id = None # self.m_renderer = QSvgRenderer("svg/" + unitOperationType + ".svg") # self.m_renderer = QSvgRenderer(fileImporter(f'svg/{unitOperationType}.svg')) self.m_renderer = QSvgRenderer(fileImporter(f'svg/ellipse.svg')) |