summaryrefslogtreecommitdiff
path: root/Graphics.py
diff options
context:
space:
mode:
authorbrenda-br2023-01-30 14:06:22 +0530
committerbrenda-br2023-01-30 14:06:22 +0530
commita9e09576c8e977e9fc838fabf2116d5e2cae9e7e (patch)
tree4ed0a08781832a7e5ffade6ea4df68d95d0122b0 /Graphics.py
parent5f5ad56c8946a56eb049310e10ee212c96978ddb (diff)
downloadChemical-Simulator-GUI-a9e09576c8e977e9fc838fabf2116d5e2cae9e7e.tar.gz
Chemical-Simulator-GUI-a9e09576c8e977e9fc838fabf2116d5e2cae9e7e.tar.bz2
Chemical-Simulator-GUI-a9e09576c8e977e9fc838fabf2116d5e2cae9e7e.zip
Fix #49 Node Lines in center of the socket after reopening
Diffstat (limited to 'Graphics.py')
-rw-r--r--Graphics.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Graphics.py b/Graphics.py
index f72ea10..d87e8b8 100644
--- a/Graphics.py
+++ b/Graphics.py
@@ -66,11 +66,11 @@ class Graphics(QDialog, QtWidgets.QGraphicsItem):
pointA = NodeItem.get_instances(v.name)
pointB = NodeItem.get_instances(i.name)
rect = pointA.output[0].boundingRect()
- pointAA = QtCore.QPointF(rect.x() + rect.width()/2, rect.y() + rect.height()/2)
+ pointAA = QtCore.QPointF(rect.x() + rect.width()/(2*3), rect.y() + rect.height()/(2*3))
pointAA = pointA.output[0].mapToScene(pointAA)
socketB = next((s for s in pointB.input if k == s.id))
rectB = socketB.boundingRect()
- pointBB = QtCore.QPointF(rectB.x() + rectB.width()/2, rectB.y() + rectB.height()/2)
+ pointBB = QtCore.QPointF(rectB.x() + rectB.width()/(2*3), rectB.y() + rectB.height()/(2*3))
pointBB = socketB.mapToScene(pointBB)
self.new_line = NodeLine(pointAA, pointBB, 'in')
self.new_line.source = pointA.output[0]
@@ -86,10 +86,10 @@ class Graphics(QDialog, QtWidgets.QGraphicsItem):
pointB = NodeItem.get_instances(v.name)
socketA = next(s for s in pointA.output if k == s.id)
rect = socketA.boundingRect()
- pointAA = QtCore.QPointF(rect.x() + rect.width()/2, rect.y() + rect.height()/2)
+ pointAA = QtCore.QPointF(rect.x() + rect.width()/(2*3), rect.y() + rect.height()/(2*3))
pointAA = socketA.mapToScene(pointAA)
rectB = pointB.input[0].boundingRect()
- pointBB = QtCore.QPointF(rectB.x() + rectB.width()/2, rectB.y() + rectB.height()/2)
+ pointBB = QtCore.QPointF(rectB.x() + rectB.width()/(2*3), rectB.y() + rectB.height()/(2*3))
pointBB = pointB.input[0].mapToScene(pointBB)
self.new_line = NodeLine(pointAA, pointBB, 'out')
self.new_line.source = socketA