Files
aida_front/src/component/Canvas/CanvasEditor/commands/PartCommands.js

27 lines
548 B
JavaScript
Raw Normal View History

2026-01-26 16:16:40 +08:00
import { Command } from "./Command.js";
/**
* 部件绘制命令
*/
export class PartDrawCommand extends Command {
constructor(options) {
super({
name: "部件绘制命令",
saveState: false,
});
this.canvas = options.canvas;
this.partManager = options.partManager;
this.partCanvas = options.partCanvas;
this.oldPartCanvas = this.partManager.partCanvas;
}
execute() {
this.partManager.drawPartCanvas(this.partCanvas);
return true;
}
undo() {
this.partManager.drawPartCanvas(this.oldPartCanvas);
return true;
}
}