summaryrefslogtreecommitdiff
path: root/src/main/python
diff options
context:
space:
mode:
authorBlaine2020-06-09 14:25:52 +0530
committerBlaine2020-06-10 11:29:49 +0530
commita4a2642e9d9934c65a853d17c899ea9337ab9c5e (patch)
treed064ee77fb0d085b6d8774f21efa6c7cbcd910bb /src/main/python
parent3ee9a4e5f976182e0193b640ad68012f6f97dba4 (diff)
downloadChemical-PFD-a4a2642e9d9934c65a853d17c899ea9337ab9c5e.tar.gz
Chemical-PFD-a4a2642e9d9934c65a853d17c899ea9337ab9c5e.tar.bz2
Chemical-PFD-a4a2642e9d9934c65a853d17c899ea9337ab9c5e.zip
complete loading
Diffstat (limited to 'src/main/python')
-rw-r--r--src/main/python/utils/canvas.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/main/python/utils/canvas.py b/src/main/python/utils/canvas.py
index d1da9bc..93a7722 100644
--- a/src/main/python/utils/canvas.py
+++ b/src/main/python/utils/canvas.py
@@ -144,6 +144,8 @@ class canvas(QWidget):
graphic.__setstate__(dict = item)
self.painter.addItem(graphic)
graphic.setPos(*item['pos'])
+ graphic.updateLineGripItem()
+ graphic.updateSizeGripItem()
for gripitem in item['lineGripItems']:
shapeGrips[gripitem[0]] = (graphic, gripitem[1])
@@ -151,18 +153,21 @@ class canvas(QWidget):
line = shapes.Line(QPointF(*item['startPoint']), QPointF(*item['endPoint']))
lines[item['id']] = line
line.__setstate__(dict = item)
+ self.painter.addItem(line)
graphic, index = shapeGrips[item['startGripItem']]
- line.setStartGripItem = graphic.lineGripItems[index]
+ line.startGripItem = graphic.lineGripItems[index]
graphic.lineGripItems[index].line = line
- if item['endGripItem']:
+ if item['endGripItem']:
graphic, index = shapeGrips[item['endGripItem']]
- line.setEndGripItem = graphic.lineGripItems[index]
+ print(graphic.lineGripItems[index])
+ line.endGripItem = graphic.lineGripItems[index]
graphic.lineGripItems[index].line = line
else:
line.refLine = lines[item['refLine']]
+ lines[item['refLine']].midLines.append(line)
line.refIndex = item['refIndex']
- self.painter.addItem(line)
- # line.addGrabber()
+ line.updateLine()
+ line.addGrabber()
shapeGrips.clear()
lines.clear()