Skip to content

Commit

Permalink
Update add-border-segments.js
Browse files Browse the repository at this point in the history
  • Loading branch information
RohitPaul0007 authored Sep 10, 2023
1 parent 215449a commit a016e9b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/add-border-segments.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
var util = require("./util");
let util = require("./util");

module.exports = addBorderSegments;

function addBorderSegments(g) {
function dfs(v) {
var children = g.children(v);
var node = g.node(v);
let children = g.children(v);
let node = g.node(v);
if (children.length) {
children.forEach(dfs);
}

if (node.hasOwnProperty("minRank")) {
node.borderLeft = [];
node.borderRight = [];
for (var rank = node.minRank, maxRank = node.maxRank + 1;
for (let rank = node.minRank, maxRank = node.maxRank + 1;
rank < maxRank;
++rank) {
addBorderNode(g, "borderLeft", "_bl", v, node, rank);
Expand All @@ -26,9 +26,9 @@ function addBorderSegments(g) {
}

function addBorderNode(g, prop, prefix, sg, sgNode, rank) {
var label = { width: 0, height: 0, rank: rank, borderType: prop };
var prev = sgNode[prop][rank - 1];
var curr = util.addDummyNode(g, "border", label, prefix);
let label = { width: 0, height: 0, rank: rank, borderType: prop };
let prev = sgNode[prop][rank - 1];
let curr = util.addDummyNode(g, "border", label, prefix);
sgNode[prop][rank] = curr;
g.setParent(curr, sg);
if (prev) {
Expand Down

0 comments on commit a016e9b

Please sign in to comment.