修改上一步泄漏区不能变红的bug

This commit is contained in:
cjc 2022-05-09 14:47:53 +08:00
parent 7d25ea01b4
commit f9bf3575a6
2 changed files with 10 additions and 3 deletions

View File

@ -168,12 +168,18 @@ export class Reconcile {
return removedModels;
}
private getModelsById(ids: string[], modelList: SVModel[]): SVModel[] {
return modelList.filter(item =>
// 在视图上所有model中根据id查找model
private getModelsById(ids: string[], modelList: SVModel[], accumulateLeakModels: SVModel[]): SVModel[] {
const updateModels = modelList.filter(item =>
ids?.find(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 removeModels: SVModel[] = this.getRemoveModels(prevModelList, modelList, accumulateLeakModels);
const updateModels: SVModel[] = hasTriggerLastStep
? [...this.getModelsById(this.prevUpdate.pop(), modelList)]
? [...this.getModelsById(this.prevUpdate.pop(), modelList,accumulateLeakModels)]
: [
...this.getReTargetMarkers(prevModelList, modelList),
...this.getLabelChangeModels(prevModelList, modelList),

View File

@ -226,6 +226,7 @@ export class ViewContainer {
const layoutMode = this.engine.viewOptions.layoutMode;
this.accumulateLeakModels.push(...diffResult.LEAKED); // 对泄漏节点进行向后累积
this.renderer.build(renderModelList); // 首先在离屏canvas渲染先
this.layoutProvider.layoutAll(layoutGroupTable, this.accumulateLeakModels, layoutMode); // 进行布局设置model的xy样式等