From 5b527501aff6e529146a91364fa1a1b1485ef11e Mon Sep 17 00:00:00 2001 From: emkael Date: Tue, 22 May 2018 11:50:40 +0200 Subject: Fixing vertical positioning of match boxes if there's a single match in every phase --- jfr_playoff/generator.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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, -- cgit v1.2.3 From 78a319e7babdcde172afae18a2f7e21d8d16cd4b Mon Sep 17 00:00:00 2001 From: emkael Date: Fri, 6 Jul 2018 01:24:40 +0200 Subject: Adjusting match box column widths to accommodate margins/borders, so the table fits the bounding box --- jfr_playoff/generator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jfr_playoff/generator.py b/jfr_playoff/generator.py index 98bd3fc..0eaee85 100644 --- a/jfr_playoff/generator.py +++ b/jfr_playoff/generator.py @@ -55,8 +55,8 @@ class PlayoffGenerator(object): team_html, p_temp.MATCH_LINK % (match.link, score_html) if match.link is not None else score_html) html = p_temp.MATCH_TABLE.decode('utf8') % ( - int(self.page['width'] * 0.75), - int(self.page['width'] * 0.25), + int(self.page['width'] * 0.7), + int(self.page['width'] * 0.2), rows) if match.running > 0: running_html = p_temp.MATCH_RUNNING % (match.running) -- cgit v1.2.3