Fixed column spacing error
This commit is contained in:
parent
b746c13113
commit
be1a89ae7b
1 changed files with 5 additions and 3 deletions
|
@ -26,6 +26,7 @@ class TableTextDesign (TextDesign):
|
|||
if self.max_col_size is not None:
|
||||
return
|
||||
|
||||
partial_col_spacing = int(self.col_spacing * (len(self.matrix[0]) - 1) / len(self.matrix[0]) - 1)
|
||||
font = self.__get_font__()
|
||||
col_sizes = []
|
||||
for c in range(len(self.matrix[0])): #amout of columns
|
||||
|
@ -36,7 +37,7 @@ class TableTextDesign (TextDesign):
|
|||
elif row_col_size > col_sizes[c]:
|
||||
col_sizes[c] = row_col_size
|
||||
|
||||
self.max_col_size = col_sizes
|
||||
self.max_col_size = [size - partial_col_spacing for size in col_sizes]
|
||||
|
||||
def __get_truncated_counts__ (self):
|
||||
max_col = 0
|
||||
|
@ -78,11 +79,12 @@ class TableTextDesign (TextDesign):
|
|||
return (xpos, ypos)
|
||||
|
||||
def __get_cell_sizes__ (self):
|
||||
partial_col_spacing = int(self.col_spacing * (len(self.matrix[0]) - 1) / len(self.matrix[0]) - 1)
|
||||
size_matrix = []
|
||||
for r in range(len(self.matrix)):
|
||||
size_matrix.append([])
|
||||
for c in range(len(self.matrix[0])):
|
||||
size = (self.max_col_size[c], int(self.font_size * 1.1))
|
||||
size = (self.max_col_size[c] - partial_col_spacing, int(self.font_size * 1.1))
|
||||
size_matrix[r].append(size)
|
||||
return size_matrix
|
||||
|
||||
|
|
Loading…
Reference in a new issue