summaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorBlaine2020-06-09 14:25:52 +0530
committerBlaine2020-06-09 14:25:52 +0530
commit1c66b73320988d8e6246e748ba6e180cc1aced05 (patch)
treeb12a59faab618047a3fe75b962de05daec27a7b9 /src/main
parentebabbede5235533360c5ff9165784b3b7b7ad94c (diff)
downloadChemical-PFD-1c66b73320988d8e6246e748ba6e180cc1aced05.tar.gz
Chemical-PFD-1c66b73320988d8e6246e748ba6e180cc1aced05.tar.bz2
Chemical-PFD-1c66b73320988d8e6246e748ba6e180cc1aced05.zip
complete loading
Diffstat (limited to 'src/main')
-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()