diff --git a/src/renderer/public/imgs/erase.svg b/src/renderer/public/imgs/erase.svg new file mode 100644 index 0000000..a746074 --- /dev/null +++ b/src/renderer/public/imgs/erase.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/renderer/src/plugins/fabric/index.js b/src/renderer/src/plugins/fabric/index.js index cb16fb9..4d6926b 100644 --- a/src/renderer/src/plugins/fabric/index.js +++ b/src/renderer/src/plugins/fabric/index.js @@ -624,7 +624,7 @@ export class History { const canvas = this.FabricVue?.canvas if (canvas) { this.diffs = this.diffs.slice(0, this.index) - const canvasJson = Utils.getCanvasJSON() + const canvasJson = Utils.getCanvasJSON(canvas) const delta = diff(canvasJson, this.canvasData) this.diffs.push(delta) @@ -686,7 +686,7 @@ export class History { initHistory() { const canvas = this.FabricVue.canvas if (canvas) { - const canvasJson = Utils.getCanvasJSON() + const canvasJson = Utils.getCanvasJSON(canvas) this.canvasData = canvasJson this.index = 0 this.diffs = [] @@ -1010,4 +1010,5 @@ export class fabricVue { } export const FabricVue = new fabricVue() export default FabricVue +export const Fabric = fabric diff --git a/src/renderer/src/views/tool/test.vue b/src/renderer/src/views/tool/test.vue index d49b599..1deb706 100644 --- a/src/renderer/src/views/tool/test.vue +++ b/src/renderer/src/views/tool/test.vue @@ -1,6 +1,9 @@