diff options
author | emkael <emkael@tlen.pl> | 2017-02-26 11:28:13 +0100 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2017-02-26 11:28:13 +0100 |
commit | a7a9fb9315729ef124371ad7a07094b2500e4318 (patch) | |
tree | 3a70b5dd9e1e968d097f34d6866b2c61801a353c /playoff.js | |
parent | c10cb786bcb5abaa8ca74edcefee80e4bd5b5d73 (diff) |
Fix aggregating connecting lines from different phases
Diffstat (limited to 'playoff.js')
-rw-r--r-- | playoff.js | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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]; |