From 0678a6711a4d51b9c190887916d1a4344a3a2ee9 Mon Sep 17 00:00:00 2001 From: Maximilian Giller Date: Sun, 3 Mar 2019 14:53:54 +0100 Subject: [PATCH] Added line and column spacing --- Calendar/TableTextDesign.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Calendar/TableTextDesign.py b/Calendar/TableTextDesign.py index 4d22ec3..0139ea9 100644 --- a/Calendar/TableTextDesign.py +++ b/Calendar/TableTextDesign.py @@ -3,10 +3,12 @@ from TextDesign import TextDesign class TableTextDesign(TextDesign): """Gets a matrix with text that is than displayed in a table without borders.""" - def __init__(self, size, text_matrix, max_col_size=None, font = None, fontsize = 12, horizontalalignment = "left", verticalalignment = "top", mask = True): + def __init__(self, size, text_matrix, max_col_size=None, font = None, fontsize = 12, horizontalalignment = "left", verticalalignment = "top", mask = True, line_spacing = 0, col_spacing = 0): super(TableTextDesign, self).__init__(size, font=font, fontsize=fontsize, horizontalalignment=horizontalalignment, verticalalignment=verticalalignment, mask=mask) self.matrix = text_matrix self.max_col_size = max_col_size + self.line_spacing = line_spacing + self.col_spacing = col_spacing def __finish_image__(self): self.__reform_col_size__() @@ -46,8 +48,10 @@ class TableTextDesign(TextDesign): xpos, ypos = (0, 0) for c in range(col): xpos += self.cell_sizes[row][c][0] + xpos += self.col_spacing for r in range(row): ypos += self.cell_sizes[r][col][1] + ypos += self.line_spacing return (xpos, ypos) def __get_cell_sizes__(self):