From a7a9fb9315729ef124371ad7a07094b2500e4318 Mon Sep 17 00:00:00 2001 From: emkael Date: Sun, 26 Feb 2017 11:28:13 +0100 Subject: Fix aggregating connecting lines from different phases --- playoff.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'playoff.js') diff --git a/playoff.js b/playoff.js index 3075d27..de3d154 100644 --- a/playoff.js +++ b/playoff.js @@ -3,8 +3,8 @@ var playoff = { settings: { 'winner_h_offset': 10, 'loser_h_offset': 20, - 'winner_v_offset': -4, - 'loser_v_offset': 4, + 'winner_v_offset': -6, + 'loser_v_offset': 6, 'loser_colour': '#ff0000', 'winner_colour': '#00ff00' }, @@ -53,10 +53,13 @@ var playoff = { parseInt(box.style.left) + parseInt(box.clientWidth) + this.settings[type + '_h_offset'], parseInt(box.style.top) + 0.5 * parseInt(box.clientHeight) + this.settings[type + '_v_offset'] ]; + console.log(from, line); horizontal_from.push(line); for (var l in horizontal_from) { if (horizontal_from[l][2] < line[2]) { horizontal_from[l][2] = line[2]; + } else { + line[2] = horizontal_from[l][2]; } if (vertical_from[0] < horizontal_from[l][2]) { vertical_from[0] = horizontal_from[l][2]; @@ -84,6 +87,8 @@ var playoff = { for (var l in horizontal_to) { if (horizontal_to[l][2] > line[2]) { horizontal_to[l][2] = line[2]; + } else { + line[2] = horizontal_to[l][2]; } if (vertical_to[0] > horizontal_to[l][2]) { vertical_to[0] = horizontal_to[l][2]; -- cgit v1.2.3