增加进入新函数不计算泄露结点的功能

This commit is contained in:
cjc
2022-02-25 17:32:20 +08:00
parent 7bba64cc9e
commit afbe7055e2
6 changed files with 11738 additions and 172 deletions
+2 -2
View File
@@ -367,9 +367,9 @@ export class Reconcile {
* @param accumulateLeakModels
* @returns
*/
public diff(layoutGroupTable: LayoutGroupTable, prevModelList: SVModel[], modelList: SVModel[], accumulateLeakModels: SVModel[]): DiffResult {
public diff(layoutGroupTable: LayoutGroupTable, prevModelList: SVModel[], modelList: SVModel[], accumulateLeakModels: SVModel[], isEnterFunction: boolean): DiffResult {
const continuousModels: SVModel[] = this.getContinuousModels(prevModelList, modelList);
const leakModels: SVModel[] = this.getLeakModels(layoutGroupTable, prevModelList, modelList);
const leakModels: SVModel[] = isEnterFunction? []: this.getLeakModels(layoutGroupTable, prevModelList, modelList);
const appendModels: SVModel[] = this.getAppendModels(prevModelList, modelList, accumulateLeakModels);
const removeModels: SVModel[] = this.getRemoveModels(prevModelList, modelList);
const updateModels: SVModel[] = [
+2 -2
View File
@@ -140,9 +140,9 @@ export class ViewContainer {
* @param models
* @param layoutFn
*/
render(layoutGroupTable: LayoutGroupTable) {
render(layoutGroupTable: LayoutGroupTable, isEnterFunction: boolean) {
const modelList = Util.convertGroupTable2ModelList(layoutGroupTable),
diffResult = this.reconcile.diff(this.layoutGroupTable, this.prevModelList, modelList, this.accumulateLeakModels),
diffResult = this.reconcile.diff(this.layoutGroupTable, this.prevModelList, modelList, this.accumulateLeakModels, isEnterFunction),
renderModelList = [
...modelList,
...diffResult.REMOVE,
+1 -1
View File
@@ -67,7 +67,7 @@ export class Engine {
const layoutGroupTable = this.modelConstructor.construct(source);
// 2 渲染(使用g6进行渲染)
this.viewContainer.render(layoutGroupTable);
this.viewContainer.render(layoutGroupTable, source.isEnterFunction as boolean);
}
+2 -1
View File
@@ -19,7 +19,8 @@ export type Sources = {
[key: string]: {
data: SourceNode[];
layouter: string;
}
};
isEnterFunction?: any;
};