mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Printing: get the number of pages from the full resolution
When we calculate the number of pages to print we need to check if the template doesn't define the number of dives per one page, then render as much dives as we can fit in one page. A dive can be broken into many pages. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This commit is contained in:
parent
c6116b0269
commit
9fd5221666
1 changed files with 6 additions and 1 deletions
|
@ -160,7 +160,12 @@ void Printer::print()
|
|||
divesPerPage = 1; // print each dive in a single page if the attribute is missing or malformed
|
||||
//TODO: show warning
|
||||
}
|
||||
int Pages = ceil(getTotalWork(printOptions) / (float)divesPerPage);
|
||||
int Pages;
|
||||
if (divesPerPage == 0) {
|
||||
Pages = ceil(webView->page()->mainFrame()->contentsSize().height() / (float)pageSize.height());
|
||||
} else {
|
||||
Pages = ceil(getTotalWork(printOptions) / (float)divesPerPage);
|
||||
}
|
||||
render(Pages);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue