深度画布测试保存
This commit is contained in:
@@ -343,10 +343,11 @@ export class LayerManager {
|
||||
const index = this.canvasManager.getObjects().indexOf(targetLayer);
|
||||
this.deleteLayerById(targetLayer.info.id, false)
|
||||
this.setActiveID(mergedImage.info.id, false)
|
||||
await this.canvasManager.add(mergedImage);
|
||||
await this.canvasManager.add(mergedImage, false);
|
||||
this.canvasManager.canvas.moveTo(mergedImage, index);
|
||||
this.canvasManager.renderAll()
|
||||
this.updateLayers()
|
||||
this.stateManager.recordState()
|
||||
return true;
|
||||
}
|
||||
/** 设置激活对象可擦除 */
|
||||
|
||||
@@ -92,7 +92,7 @@ export class StateManager {
|
||||
if (!state) return
|
||||
this.running.value = true
|
||||
this.historyIndex.value = index
|
||||
this.canvasManager.loadJSON(state.canvas, () => {
|
||||
this.canvasManager.loadJSON(state.canvas).then(() => {
|
||||
this.event.emit('canvas:undo', state)
|
||||
this.running.value = false
|
||||
})
|
||||
@@ -105,7 +105,7 @@ export class StateManager {
|
||||
if (!state) return
|
||||
this.running.value = true
|
||||
this.historyIndex.value = index
|
||||
this.canvasManager.loadJSON(state.canvas, () => {
|
||||
this.canvasManager.loadJSON(state.canvas).then(() => {
|
||||
this.event.emit('canvas:redo', state)
|
||||
this.running.value = false
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user