From e197341c6f2a234b6c2b266450b8564a9125fcc1 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 6d107bd..22bdc82 100644 --- a/jfr_playoff/generator.py +++ b/jfr_playoff/generator.py @@ -137,7 +137,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'])) PlayoffLogger.get('generator').info( 'grid box (%d, %d) position: (%d, %d)', -- cgit v1.2.3