画布增加的新功能
This commit is contained in:
@@ -8,6 +8,7 @@ import { PerformanceManager } from "./PerformanceManager.js";
|
||||
*/
|
||||
export class CommandManager {
|
||||
constructor(options = {}) {
|
||||
this.canvas = options.canvas;
|
||||
this.undoStack = [];
|
||||
this.redoStack = [];
|
||||
this.maxHistorySize = options.maxHistorySize || 50;
|
||||
@@ -205,6 +206,7 @@ export class CommandManager {
|
||||
const startTime = performance.now();
|
||||
|
||||
try {
|
||||
this.canvas?.discardActiveObject();
|
||||
const command = this.undoStack.pop();
|
||||
console.log(`↩️ 撤销命令: ${command.constructor.name}`);
|
||||
|
||||
@@ -243,6 +245,7 @@ export class CommandManager {
|
||||
const startTime = performance.now();
|
||||
|
||||
try {
|
||||
this.canvas?.discardActiveObject();
|
||||
const command = this.redoStack.pop();
|
||||
console.log(`↪️ 重做命令: ${command.constructor.name}`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user