修改上一步下一步的bug

This commit is contained in:
cjc 2022-06-13 17:08:25 +08:00
parent 3ad6bbc3e3
commit e3d757173e

View File

@ -28,6 +28,10 @@ export class ViewContainer {
private prevModelList: SVModel[]; private prevModelList: SVModel[];
private accumulateLeakModels: SVModel[]; private accumulateLeakModels: SVModel[];
private preIsFirstDebug: boolean[]; //存储以前的handleUpdate
private stackAddress: number //指向preHandleUpdate的栈地址
private preCount: number; //点击上一步的次数
public hasLeak: boolean; public hasLeak: boolean;
public leakAreaY: number; public leakAreaY: number;
public lastLeakAreaTranslateY: number; public lastLeakAreaTranslateY: number;
@ -48,6 +52,9 @@ export class ViewContainer {
this.brushSelectedModels = []; this.brushSelectedModels = [];
this.clickSelectNode = null; this.clickSelectNode = null;
this.lastLeakAreaTranslateY = 0; this.lastLeakAreaTranslateY = 0;
this.preIsFirstDebug = [];
this.preCount = 0;
this.stackAddress = 0;
const g6Instance = this.renderer.getG6Instance(), const g6Instance = this.renderer.getG6Instance(),
leakAreaHeight = this.engine.viewOptions.leakAreaHeight, leakAreaHeight = this.engine.viewOptions.leakAreaHeight,
@ -191,10 +198,21 @@ export class ViewContainer {
this.setPrevUpdateId([]) this.setPrevUpdateId([])
return; return;
} }
// 判断是否需要进行泄漏区的比较 // 判断是否需要进行泄漏区的比较
let isDiffLeak = handleUpdate?.isEnterFunction || handleUpdate?.hasTriggerLastStep; let isDiffLeak = handleUpdate?.isEnterFunction || handleUpdate?.hasTriggerLastStep;
if (!handleUpdate?.hasTriggerLastStep) {
this.preCount++;
} else {
this.preCount--;
}
//preCount用来判断是否是第一次进入调试因为刚开始调试后点击下一步再点上一步后端给回的isFirstDebug = false因改为true
if (this.preCount === 1 || this.preCount === 2) {
console.log(this.preCount);
handleUpdate.isFirstDebug = true;
}
const diffResult = this.reconcile.diff( const diffResult = this.reconcile.diff(
this.layoutGroupTable, this.layoutGroupTable,
this.prevModelList, this.prevModelList,