fix:修复外部指针问题

This commit is contained in:
黎智洲 2022-05-08 00:15:46 +08:00
parent a297a38adc
commit 7d25ea01b4
4 changed files with 25 additions and 24 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
node_modules node_modules
test test
dist dist
资料

View File

@ -16,7 +16,6 @@ export class SVNode extends SVModel {
}; };
private label: string | string[]; private label: string | string[];
private disable: boolean;
public appendages: { [key: string]: SVNodeAppendage[] }; public appendages: { [key: string]: SVNodeAppendage[] };
constructor( constructor(

View File

@ -196,6 +196,7 @@ export class SVMarker extends SVNodeAppendage {
label: this.label, label: this.label,
style: Util.objectClone<Style>(options.style), style: Util.objectClone<Style>(options.style),
labelCfg: Util.objectClone<NodeLabelOption>(options.labelOptions), labelCfg: Util.objectClone<NodeLabelOption>(options.labelOptions),
targetSourceNode: this.target.sourceNode
}; };
} }

View File

@ -415,7 +415,9 @@ export class Reconcile {
const leakModels: SVModel[] = isDiffLeak ? [] : this.getLeakModels(layoutGroupTable, prevModelList, modelList); const leakModels: SVModel[] = isDiffLeak ? [] : this.getLeakModels(layoutGroupTable, prevModelList, modelList);
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 ? [...this.getModelsById(this.prevUpdate.pop(), modelList)]: [ const updateModels: SVModel[] = hasTriggerLastStep
? [...this.getModelsById(this.prevUpdate.pop(), modelList)]
: [
...this.getReTargetMarkers(prevModelList, modelList), ...this.getReTargetMarkers(prevModelList, modelList),
...this.getLabelChangeModels(prevModelList, modelList), ...this.getLabelChangeModels(prevModelList, modelList),
...this.filterUnChangeModelsOfAppend(appendModels, prevModelList), ...this.filterUnChangeModelsOfAppend(appendModels, prevModelList),
@ -427,8 +429,6 @@ export class Reconcile {
UpdateModelsId.push(model.id); UpdateModelsId.push(model.id);
} }
this.prevUpdate?.push(UpdateModelsId); this.prevUpdate?.push(UpdateModelsId);
console.log(this.prevUpdate);
const freedModels: SVNode[] = this.getFreedModels(prevModelList, modelList); const freedModels: SVNode[] = this.getFreedModels(prevModelList, modelList);