diff --git a/photobook/photobook.py b/photobook/photobook.py index 9c7e1ae..5c4c389 100644 --- a/photobook/photobook.py +++ b/photobook/photobook.py @@ -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):