Skip to content

Commit

Permalink
Fix the calculation of the no. of puzzles in the PDF export
Browse files Browse the repository at this point in the history
A page was missing when the no. of puzzles didn't fill all the
possible pages.
  • Loading branch information
brianch committed Feb 13, 2024
1 parent 210b7d5 commit 9a92841
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ pub fn to_pdf(puzzles: &Vec<config::Puzzle>, number_of_pages: i32, lang: &lang::
let num_of_pages;
if (6 * number_of_pages) as usize > puzzles.len() {
num_of_puzzles_to_print = puzzles.len();
num_of_pages = puzzles.len() % 6;
num_of_pages = (puzzles.len() as f32 / 6.0).ceil() as usize;
} else {
num_of_puzzles_to_print = (6 * number_of_pages) as usize;
num_of_pages = number_of_pages as usize;
Expand Down

1 comment on commit 9a92841

@brianch
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

**Multiple pages were missing I should've said

Please sign in to comment.