From d1d8bef3b5e581a354bb94ba155ac5e9bf61ce78 Mon Sep 17 00:00:00 2001 From: Cullie Date: Wed, 25 Aug 2021 10:47:44 +1000 Subject: [PATCH] #41 - Removed Debug and Lint Fix --- src/controllers/EditorController.ts | 2 +- src/views/ts/nodeView.ts | 29 +++-------------------------- 2 files changed, 4 insertions(+), 27 deletions(-) diff --git a/src/controllers/EditorController.ts b/src/controllers/EditorController.ts index 0b99f4f..3b264ce 100644 --- a/src/controllers/EditorController.ts +++ b/src/controllers/EditorController.ts @@ -193,7 +193,7 @@ export class EditorController console.log("Doing the jumps"); //if (currentObject.returnJumps.length !== 0) //{ - nodeView.receiveJumps(currentObject.returnJumps); + nodeView.receiveJumps(currentObject.returnJumps); //} break; diff --git a/src/views/ts/nodeView.ts b/src/views/ts/nodeView.ts index e911acb..331860d 100644 --- a/src/views/ts/nodeView.ts +++ b/src/views/ts/nodeView.ts @@ -671,23 +671,22 @@ export function addNode(node: YarnNode) : void */ export function receiveJumps(jumps: NodeJump[]) : void { - //DESTROY ALL THE ARROWS jumpMap.forEach(arrow => { arrow.destroy(); }); - //CLEAR THE MAP jumpMap.clear(); + //Required for when the below loop is not entered. + updateMiniMap(); + //DRAW ALL THE NEW ARROWS for (let i = 0; i < jumps.length ; i++) { connectNodes(jumps[i].getSource(), jumps[i].getTarget()); } - console.log("jumpMapLength HERE "+jumpMap.size); // ! DEBUG - console.log("jumps param length here HERE "+jumps.length); /* const oldJumps = Array.from(jumpMap.keys()); const newJumps = new Array>(); @@ -753,26 +752,4 @@ export function receiveJumps(jumps: NodeJump[]) : void removeJump(deletedJump[0], deletedJump[1]); }); */ - -} - -/** - * * Delete jumps - * Should just be: - * get([from,to]).destroy(); - * delete([from,to]); - * @param {number} from The source node UID - * @param {number} to The target node UID - * @returns {void} - */ -function removeJump(from: number, to: number) -{ - jumpMap.delete([from, to]); - jumpMap.forEach((value, key) => - { - if(key[0] == from && key[1] == to) - { - value.destroy(); - } - }); } \ No newline at end of file