Skip to content

Commit

Permalink
fix page range calculation for reverse assembly
Browse files Browse the repository at this point in the history
  • Loading branch information
bytinbit committed Jan 28, 2021
1 parent 4d916c9 commit 0312f6c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion nobubo/assembly.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def _assemble(input_properties: core.InputProperties,

if input_properties.reverse_assembly:
start, end, step = calc.pagerange_reverse(current_layout)
l = list(reversed([(x+1, x+current_layout.columns) for x in range(start, end, step)]))
l = list(reversed([(x, x+current_layout.columns-1) for x in range(start, end, step)]))
tuples = ["-".join(map(str, i)) for i in l]
page_range = ",".join(tuples)
else:
Expand Down
2 changes: 1 addition & 1 deletion nobubo/calc.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def to_mm(output_layout: str) -> [int, int]:


def pagerange_reverse(layout: core.Layout) -> (int, int, int):
return layout.first_page, (layout.first_page + (layout.columns * layout.rows)), layout.columns
return layout.first_page, layout.first_page + (layout.columns * layout.rows) - 1, layout.columns


def new_outputpath(output_path: pathlib.Path, page_count: int):
Expand Down

0 comments on commit 0312f6c

Please sign in to comment.