优化对象被改变时产生的历史记录

pull/550/head
ChenX 5 years ago
parent 0c76233f85
commit 8e17b02061

@ -167,7 +167,7 @@ export abstract class CADObject
let undoData = this.UndoRecord();
if (undoData)
{
undoData.CreateObjectHistory(this);
undoData.WriteObjectSnapshoot(this);
return true;
}
return false;

@ -76,16 +76,23 @@ export class CommandHistoryRecord extends CADObject
hrs.push(history);
}
CreateObjectHistory(obj: CADObject): ObjectAllDataHistoryRecord
WriteObjectSnapshoot(obj: CADObject): void
{
if (!obj.Id)
{
console.warn("错误!CreateObjectHistory");
return;
}
if (this._CreateObjects.has(obj))
return;
let hrs = this.GetObjectHistoryList(obj.Id);
if (this.GetObjectAllDataRecord(hrs))
return;
let hr = new ObjectAllDataHistoryRecord(obj.Id);
this.WriteObjectHistoryPath(obj, hr);
return hr;
hrs.push(hr);
}
CreateEraseHistory(obj: CADObject, isErase: boolean)

Loading…
Cancel
Save