fix: 修复泄漏区布局问题

This commit is contained in:
黎智洲
2022-02-25 18:35:16 +08:00
6 changed files with 144 additions and 176 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, a: boolean) {
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, source.enterFunction as boolean);
this.viewContainer.render(layoutGroupTable, source.isEnterFunction as boolean);
}
+2 -1
View File
@@ -20,7 +20,8 @@ export type Sources = {
[key: string]: {
data: SourceNode[];
layouter: string;
}
};
isEnterFunction?: any;
};