canvas-editor-engine 1.1.31 → 1.1.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/types/history.d.ts
CHANGED
|
@@ -10,7 +10,31 @@ class ProjectFileSerializer {
|
|
|
10
10
|
}
|
|
11
11
|
;
|
|
12
12
|
load() {
|
|
13
|
-
|
|
13
|
+
const rowProjects = JSON.parse(this.file);
|
|
14
|
+
const imageDataProcessor = (imageData) => {
|
|
15
|
+
const _imageData = Object.assign(imageData, {});
|
|
16
|
+
const tempCanvas = document.createElement('canvas');
|
|
17
|
+
const tempCtx = tempCanvas.getContext('2d');
|
|
18
|
+
const tempImageData = tempCtx.createImageData(_imageData.width, _imageData.height);
|
|
19
|
+
_imageData.data.forEach((colorAtom, index) => {
|
|
20
|
+
tempImageData.data[index] = colorAtom;
|
|
21
|
+
});
|
|
22
|
+
return tempImageData;
|
|
23
|
+
};
|
|
24
|
+
// const projects = rowProjects.map((project) => {
|
|
25
|
+
// project.state.current.imageData = imageDataProcessor(project.state.current.imageData);
|
|
26
|
+
// project.state.history = project.state.history.map((historyLine) => {
|
|
27
|
+
// historyLine.stateValue.tempImageData = imageDataProcessor(historyLine.stateValue.tempImageData);
|
|
28
|
+
// return historyLine;
|
|
29
|
+
// });
|
|
30
|
+
// project.state.cache = project.state.cache.map((historyLine) => {
|
|
31
|
+
// historyLine.stateValue.tempImageData = imageDataProcessor(historyLine.stateValue.tempImageData);
|
|
32
|
+
// return historyLine;
|
|
33
|
+
// });
|
|
34
|
+
// return project;
|
|
35
|
+
// });
|
|
36
|
+
// return projects;
|
|
37
|
+
return [{}];
|
|
14
38
|
}
|
|
15
39
|
saveProjects(projects) {
|
|
16
40
|
this.file.save(JSON.stringify(projects));
|