summaryrefslogtreecommitdiff
path: root/jfr_playoff/generator.py
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2018-05-22 11:50:40 +0200
committeremkael <emkael@tlen.pl>2018-05-22 11:50:40 +0200
commit5b527501aff6e529146a91364fa1a1b1485ef11e (patch)
treea3bf9e2af5e8bf09b6f5ed3fc43b877a5e37d3f9 /jfr_playoff/generator.py
parent9a5f06ee9cddd38e11f49a2f934de202d34e63e2 (diff)
Fixing vertical positioning of match boxes if there's a single match in every phase
Diffstat (limited to 'jfr_playoff/generator.py')
-rw-r--r--jfr_playoff/generator.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/jfr_playoff/generator.py b/jfr_playoff/generator.py
index 2b5aaf0..98bd3fc 100644
--- a/jfr_playoff/generator.py
+++ b/jfr_playoff/generator.py
@@ -109,7 +109,8 @@ class PlayoffGenerator(object):
match_height = canvas_size[1] / len(phase.matches)
row_no = 0
for match in phase.matches:
- grid_y = int(row_no * match_height +
+ grid_y = self.page['margin'] / 2 if dimensions[1] == 1 else \
+ int(row_no * match_height +
0.5 * (match_height - self.page['height']))
grid_boxes += self.get_match_box(
matches[match] if match is not None else None,