diff options
author | brenda-br | 2023-01-19 10:34:12 +0530 |
---|---|---|
committer | brenda-br | 2023-01-19 10:34:12 +0530 |
commit | 4b65f30c2874f014d533dce9841d13b04b924d9a (patch) | |
tree | 6fb4fc041e513a3d61ab44f78e594c8d10cb5234 /Graphics.py | |
parent | 7dbb6b0e06281f37eff2179202a2ebdaf0fc2905 (diff) | |
download | Chemical-Simulator-GUI-4b65f30c2874f014d533dce9841d13b04b924d9a.tar.gz Chemical-Simulator-GUI-4b65f30c2874f014d533dce9841d13b04b924d9a.tar.bz2 Chemical-Simulator-GUI-4b65f30c2874f014d533dce9841d13b04b924d9a.zip |
Fix #33 Updated Lines when all unit operations are selected and moved
Diffstat (limited to 'Graphics.py')
-rw-r--r-- | Graphics.py | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/Graphics.py b/Graphics.py index 1478786..7d456fe 100644 --- a/Graphics.py +++ b/Graphics.py @@ -559,14 +559,17 @@ class NodeItem(QtWidgets.QGraphicsItem): def mouseMoveEvent(self, event): super(NodeItem, self).mouseMoveEvent(event) - for op in self.output: - for line in op.out_lines: - line.pointA = line.source.get_center() - line.pointB = line.target.get_center() - for ip in self.input: - for line in ip.in_lines: - line.pointA = line.source.get_center() - line.pointB = line.target.get_center() + items = self.graphicsView.items() + for i in items: + if(type(i) == NodeItem): + for op in i.output: + for line in op.out_lines: + line.pointA = line.source.get_center() + line.pointB = line.target.get_center() + for ip in i.input: + for line in ip.in_lines: + line.pointA = line.source.get_center() + line.pointB = line.target.get_center() self.pos = event.scenePos() self.obj.set_pos(self.pos) |