红绿图导出问题
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -180,7 +180,7 @@ export class CommandManager {
|
||||
this._recordPerformance("execute", command.constructor.name, duration);
|
||||
|
||||
// 通知状态变化
|
||||
this._notifyStateChange();
|
||||
this._notifyStateChange("execute");
|
||||
|
||||
console.log(`✅ 命令执行成功: ${command.constructor.name}`);
|
||||
return result;
|
||||
@@ -219,7 +219,7 @@ export class CommandManager {
|
||||
this._recordPerformance("undo", command.constructor.name, duration);
|
||||
|
||||
// 通知状态变化
|
||||
this._notifyStateChange();
|
||||
this._notifyStateChange("undo");
|
||||
|
||||
console.log(`✅ 命令撤销成功: ${command.constructor.name}`);
|
||||
return result;
|
||||
@@ -258,7 +258,7 @@ export class CommandManager {
|
||||
this._recordPerformance("redo", command.constructor.name, duration);
|
||||
|
||||
// 通知状态变化
|
||||
this._notifyStateChange();
|
||||
this._notifyStateChange("redo");
|
||||
|
||||
console.log(`✅ 命令重做成功: ${command.constructor.name}`);
|
||||
return result;
|
||||
@@ -298,7 +298,7 @@ export class CommandManager {
|
||||
|
||||
this.undoStack = [];
|
||||
this.redoStack = [];
|
||||
this._notifyStateChange();
|
||||
this._notifyStateChange("clear");
|
||||
// console.log("📝 命令历史已清空");
|
||||
}
|
||||
|
||||
@@ -417,10 +417,12 @@ export class CommandManager {
|
||||
* 通知状态变化
|
||||
* @private
|
||||
*/
|
||||
_notifyStateChange() {
|
||||
_notifyStateChange(type) {
|
||||
if (this.onStateChange) {
|
||||
try {
|
||||
this.onStateChange(this.getState());
|
||||
const obj = this.getState();
|
||||
obj.type = type;
|
||||
this.onStateChange(obj);
|
||||
} catch (error) {
|
||||
console.error("状态变化回调执行失败:", error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user