优化对象移出时的历史记录

pull/450/MERGE
ChenX 5 years ago
parent d225dbb1f7
commit 36c18184da

@ -29,6 +29,8 @@ export abstract class CADObject
//对象被彻底遗弃
GoodBye(): any
{
this.Destroy();
this.Erase(true);
}
/**

@ -356,6 +356,7 @@ export class Entity extends CADObject
GoodBye()
{
super.GoodBye();
if (this._drawObject && this._drawObject.parent)
this._drawObject.parent.remove(this._drawObject);
this.ClearDraw();

@ -56,9 +56,6 @@ export class ObjectCollection<T extends CADObject> extends CADObject
if (index === -1)
return;
let obj = this.Objects[index];
obj.Erase(); //TODO: 导致了多余的历史记录
obj.GoodBye();
this.Objects.splice(index, 1);
let undoRec = this.UndoRecord();
@ -70,6 +67,7 @@ export class ObjectCollection<T extends CADObject> extends CADObject
undoRec.WriteObjectHistoryPath(this, hisRec);
}
obj.GoodBye();
}
//#region -----------------------------File-----------------------------

Loading…
Cancel
Save