summaryrefslogtreecommitdiff
path: root/src/main/python/utils/canvas.py
diff options
context:
space:
mode:
authorBlaine2020-06-09 04:53:48 +0530
committerBlaine2020-06-09 04:53:48 +0530
commit994a0f5c1fb80d0065b8fd3134111ca8790b46bd (patch)
tree420407e3c38806ca9e1461713c31bc890dcf3f89 /src/main/python/utils/canvas.py
parentbfa6cdf2e858e4a08e7e51dbf6d6cddc8d4183b7 (diff)
downloadChemical-PFD-994a0f5c1fb80d0065b8fd3134111ca8790b46bd.tar.gz
Chemical-PFD-994a0f5c1fb80d0065b8fd3134111ca8790b46bd.tar.bz2
Chemical-PFD-994a0f5c1fb80d0065b8fd3134111ca8790b46bd.zip
conflicted commits
Diffstat (limited to 'src/main/python/utils/canvas.py')
-rw-r--r--src/main/python/utils/canvas.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/main/python/utils/canvas.py b/src/main/python/utils/canvas.py
index dee0745..10601f2 100644
--- a/src/main/python/utils/canvas.py
+++ b/src/main/python/utils/canvas.py
@@ -1,5 +1,3 @@
-import json
-
from PyQt5.QtCore import Qt, QPointF
from PyQt5.QtGui import QBrush, QPalette
from PyQt5.QtWidgets import (QFileDialog, QApplication, QHBoxLayout, QMenu,
@@ -8,6 +6,7 @@ from PyQt5.QtWidgets import (QFileDialog, QApplication, QHBoxLayout, QMenu,
from . import dialogs
from .graphics import customView, customScene
from .data import paperSizes, ppiList, sheetDimensionList
+from .app import dumps, loads, JSON_Typer
import shapes
@@ -129,8 +128,8 @@ class canvas(QWidget):
"ppi": self._ppi,
"canvasSize": self._canvasSize,
"ObjectName": self.objectName(),
- "symbols": [i.__getstate__() for i in self.painter.items() if isinstance(i, shapes.NodeItem)],
- "lines": [i.__getstate__() for i in self.painter.items() if isinstance(i, shapes.Line)],
+ "symbols": [dumps(i, indent=4, cls=JSON_Typer) for i in self.painter.items() if isinstance(i, shapes.NodeItem)],
+ "lines": [dumps(i, indent=4, cls=JSON_Typer) for i in self.painter.items() if isinstance(i, shapes.Line)],
# "lineLabels": [i.__getstate__() for i in self.painter.items() if isinstance(i, shapes.LineLabel)],
# "itemLabels": [i.__getstate__() for i in self.painter.items() if isinstance(i, shapes.itemLabel)]
}