Fix: alignement with layout

This commit is contained in:
Bertrand Benjamin 2023-09-05 06:22:25 +02:00
parent be80ba6959
commit 8d8db8d3b1
1 changed files with 2 additions and 2 deletions

View File

@ -248,7 +248,7 @@ class Photobook(FPDF):
height_unit = (pg_size[1] - (len(layout) - 1) * sep) / total_ratio
for (r, row) in enumerate(layout):
width_unit = (pg_size[0] - (len(row) - 1) * sep) / sum(row)
width_unit = (pg_size[0] - (sum(row) - 1) * sep) / sum(row)
row_height = height_unit * ratios[r]
for (c, weight) in enumerate(row):
@ -309,7 +309,7 @@ class Photobook(FPDF):
width_unit = (pg_size[0] - (len(layout) - 1) * sep) / total_ratio
for (c, column) in enumerate(layout):
height_unit = (pg_size[1] - (len(column) - 1) * sep) / sum(column)
height_unit = (pg_size[1] - (sum(column) - 1) * sep) / sum(column)
column_width = width_unit * ratios[c]
for (r, weight) in enumerate(column):