修改上一步泄漏区不能变红的bug
This commit is contained in:
parent
7d25ea01b4
commit
f9bf3575a6
@ -168,12 +168,18 @@ export class Reconcile {
|
|||||||
return removedModels;
|
return removedModels;
|
||||||
}
|
}
|
||||||
|
|
||||||
private getModelsById(ids: string[], modelList: SVModel[]): SVModel[] {
|
// 在视图上所有model中根据id查找model
|
||||||
return modelList.filter(item =>
|
private getModelsById(ids: string[], modelList: SVModel[], accumulateLeakModels: SVModel[]): SVModel[] {
|
||||||
|
const updateModels = modelList.filter(item =>
|
||||||
ids?.find(id => {
|
ids?.find(id => {
|
||||||
return id === item.id;
|
return id === item.id;
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
const updateLeakModels = accumulateLeakModels.filter(item =>
|
||||||
|
ids?.find(id => {
|
||||||
|
return id === item.id;
|
||||||
|
}));
|
||||||
|
return [ ...updateModels,...updateLeakModels];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -416,7 +422,7 @@ export class Reconcile {
|
|||||||
const appendModels: SVModel[] = this.getAppendModels(prevModelList, modelList, accumulateLeakModels);
|
const appendModels: SVModel[] = this.getAppendModels(prevModelList, modelList, accumulateLeakModels);
|
||||||
const removeModels: SVModel[] = this.getRemoveModels(prevModelList, modelList, accumulateLeakModels);
|
const removeModels: SVModel[] = this.getRemoveModels(prevModelList, modelList, accumulateLeakModels);
|
||||||
const updateModels: SVModel[] = hasTriggerLastStep
|
const updateModels: SVModel[] = hasTriggerLastStep
|
||||||
? [...this.getModelsById(this.prevUpdate.pop(), modelList)]
|
? [...this.getModelsById(this.prevUpdate.pop(), modelList,accumulateLeakModels)]
|
||||||
: [
|
: [
|
||||||
...this.getReTargetMarkers(prevModelList, modelList),
|
...this.getReTargetMarkers(prevModelList, modelList),
|
||||||
...this.getLabelChangeModels(prevModelList, modelList),
|
...this.getLabelChangeModels(prevModelList, modelList),
|
||||||
|
@ -226,6 +226,7 @@ export class ViewContainer {
|
|||||||
|
|
||||||
const layoutMode = this.engine.viewOptions.layoutMode;
|
const layoutMode = this.engine.viewOptions.layoutMode;
|
||||||
this.accumulateLeakModels.push(...diffResult.LEAKED); // 对泄漏节点进行向后累积
|
this.accumulateLeakModels.push(...diffResult.LEAKED); // 对泄漏节点进行向后累积
|
||||||
|
|
||||||
this.renderer.build(renderModelList); // 首先在离屏canvas渲染先
|
this.renderer.build(renderModelList); // 首先在离屏canvas渲染先
|
||||||
this.layoutProvider.layoutAll(layoutGroupTable, this.accumulateLeakModels, layoutMode); // 进行布局(设置model的x,y,样式等)
|
this.layoutProvider.layoutAll(layoutGroupTable, this.accumulateLeakModels, layoutMode); // 进行布局(设置model的x,y,样式等)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user