From 1bdd05c9d8075d2b0846edc0117368dc560dcf6c Mon Sep 17 00:00:00 2001 From: ChenX Date: Wed, 3 Jan 2018 09:40:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0todo=E4=BB=BB=E5=8A=A1.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/DatabaseServices/HistoricManage.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/DatabaseServices/HistoricManage.ts b/src/DatabaseServices/HistoricManage.ts index 417303051..047c26010 100644 --- a/src/DatabaseServices/HistoricManage.ts +++ b/src/DatabaseServices/HistoricManage.ts @@ -3,6 +3,8 @@ import { CADFile } from './CADFile'; import { CADObject } from './CADObject'; import { CommandHistoryRecord } from './CommandHistoryRecord'; +//TODO:对于空的新建命令,应该支持不清空后续命令. 比如切换相机或者切换视图. + //历史记录管理 @Factory export class HistoricManage extends CADObject @@ -89,16 +91,13 @@ export class HistoricManage extends CADObject this.EndCmd(); let historyRec = this.historyRecord[this.curIndex]; if (!historyRec) - { return false; - } this.doing = true; for (let [id, recList] of historyRec.HistoryList) { - let obj = id.Object; for (let i = recList.length; i--;) { - obj.ApplyPartialUndo(recList[i].undoData); + id.Object.ApplyPartialUndo(recList[i].undoData); } } this.curIndex--; @@ -109,16 +108,13 @@ export class HistoricManage extends CADObject { let historyRec = this.historyRecord[this.curIndex + 1]; if (!historyRec) - { return false; - } this.doing = true; for (let [id, recList] of historyRec.HistoryList) { - let obj = id.Object; for (let rec of recList) { - obj.ApplyPartialUndo(rec.redoData); + id.Object.ApplyPartialUndo(rec.redoData); } } this.curIndex++;