feat:增加命令适配层

This commit is contained in:
黄云飞
2021-11-15 20:18:49 +08:00
parent b8a3c09543
commit 0a21a0bbf5
4 changed files with 65 additions and 10 deletions
+2 -1
View File
@@ -4,6 +4,7 @@ import { IEditorOption } from './interface/Editor'
import { IElement } from './interface/Element'
import { Draw } from './core/draw/Draw'
import { Command } from './core/command/Command'
import { CommandAdapt } from './core/command/CommandAdapt'
export default class Editor {
@@ -41,7 +42,7 @@ export default class Editor {
const draw = new Draw(canvas, ctx, editorOptions, elementList)
draw.render()
// 对外命令
this.command = new Command(draw)
this.command = new Command(new CommandAdapt(draw))
}
}