多选解决

This commit is contained in:
李志鹏
2026-01-27 10:58:27 +08:00
parent 8ff7a31e92
commit 79293901b3
4 changed files with 99 additions and 55 deletions

View File

@@ -24,3 +24,33 @@ export class PartDrawCommand extends Command {
return true;
}
}
/**
* 部件点选绘制命令
*/
export class PartPointDrawCommand extends Command {
constructor(options) {
super({
name: "部件点选绘制命令",
saveState: false,
});
this.canvas = options.canvas;
this.partManager = options.partManager;
this.partCanvas = options.partCanvas;
this.pointList = options.pointList;
this.oldPartCanvas = this.partManager.partCanvas;
this.oldPointList = [...this.partManager.pointList];
}
async execute() {
const list = [...this.pointList];
const canvas = this.partCanvas;
const res = await this.partManager.pointDrawPartCanvas(list, canvas);
return res;
}
async undo() {
const list = [...this.oldPointList];
const canvas = this.oldPartCanvas;
const res = await this.partManager.pointDrawPartCanvas(list, canvas);
return res;
}
}