diff --git a/src/View/reconcile.ts b/src/View/reconcile.ts index f9a790e..d6aa6dc 100644 --- a/src/View/reconcile.ts +++ b/src/View/reconcile.ts @@ -392,10 +392,10 @@ export class Reconcile { prevModelList: SVModel[], modelList: SVModel[], accumulateLeakModels: SVModel[], - isEnterFunction: boolean + isDiffLeak: boolean ): DiffResult { const continuousModels: SVModel[] = this.getContinuousModels(prevModelList, modelList); - const leakModels: SVModel[] = isEnterFunction + const leakModels: SVModel[] = isDiffLeak ? [] : this.getLeakModels(layoutGroupTable, prevModelList, modelList); const appendModels: SVModel[] = this.getAppendModels(prevModelList, modelList, accumulateLeakModels); diff --git a/src/View/viewContainer.ts b/src/View/viewContainer.ts index 62d4c6a..258b9fb 100644 --- a/src/View/viewContainer.ts +++ b/src/View/viewContainer.ts @@ -174,7 +174,7 @@ export class ViewContainer { * @param models * @param layoutFn */ - render(layoutGroupTable: LayoutGroupTable, isSameSources: boolean, handleUpdate: handleUpdate) { + render(layoutGroupTable: LayoutGroupTable, isSameSources: boolean, handleUpdate: handleUpdate,hasTriggerLastStep: boolean) { const modelList = Util.convertGroupTable2ModelList(layoutGroupTable); this.restoreHighlight([...modelList, ...this.accumulateLeakModels]); @@ -184,12 +184,16 @@ export class ViewContainer { return; } + // 判断是否需要进行泄漏区的比较 + let isDiffLeak = handleUpdate.isEnterFunction || hasTriggerLastStep; + const diffResult = this.reconcile.diff( this.layoutGroupTable, this.prevModelList, modelList, this.accumulateLeakModels, - handleUpdate?.isEnterFunction + // handleUpdate?.isEnterFunction + isDiffLeak ), renderModelList = [...modelList, ...diffResult.REMOVE, ...diffResult.LEAKED, ...this.accumulateLeakModels]; diff --git a/src/engine.ts b/src/engine.ts index 4d3e6c3..e72d149 100644 --- a/src/engine.ts +++ b/src/engine.ts @@ -52,7 +52,7 @@ export class Engine { * @param sources * @param prevStep */ - public render(source: Sources) { + public render(source: Sources, hasTriggerLastStep: boolean) { let isSameSources: boolean = false, layoutGroupTable: LayoutGroupTable; @@ -80,7 +80,7 @@ export class Engine { } // 2 渲染(使用g6进行渲染) - this.viewContainer.render(layoutGroupTable, isSameSources, handleUpdate); + this.viewContainer.render(layoutGroupTable, isSameSources, handleUpdate, hasTriggerLastStep); }