fix
This commit is contained in:
@@ -270,7 +270,7 @@ export class CanvasManager {
|
||||
return JSON.stringify(json)
|
||||
}
|
||||
/** 加载画布JSON */
|
||||
loadJSON(json: string) {
|
||||
loadJSON(json: string, rerecord = true) {
|
||||
return new Promise((resolve) => {
|
||||
let jsonObj = null;
|
||||
try {
|
||||
@@ -280,9 +280,11 @@ export class CanvasManager {
|
||||
}
|
||||
if (!jsonObj) return resolve(false)
|
||||
this.canvas.loadFromJSON(jsonObj, () => {
|
||||
if (rerecord) this.stateManager.clearState()
|
||||
this.resetZoom(false)
|
||||
this.layerManager.updateLayers()
|
||||
this.renderAll()
|
||||
if (rerecord) this.stateManager.recordState()
|
||||
|
||||
resolve(true)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user