Merge branch 'branch_cjc1' into 'main'

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

See merge request phenomLi/StructV2!22
This commit is contained in:
chen jiancheng 2022-05-09 06:49:11 +00:00
commit bd6f9cd0d4
2 changed files with 10 additions and 3 deletions

View File

@ -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),

View File

@ -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的xy样式等 this.layoutProvider.layoutAll(layoutGroupTable, this.accumulateLeakModels, layoutMode); // 进行布局设置model的xy样式等