From 1040f0d4e57ca8ec13f9eb8e0b2214c89b90aaaf Mon Sep 17 00:00:00 2001 From: Gehad elrobey Date: Wed, 10 Jun 2015 13:39:15 +0200 Subject: Printing: fix rendering bug for odd number of dives Odd number of dives needs extra space from the buttom, so that when we scroll to the last page extra whitespace is shown under the last dive frame, this is fixed by adding a default footer to the base template. Signed-off-by: Gehad elrobey Signed-off-by: Lubomir I. Ivanov --- printer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'printer.cpp') diff --git a/printer.cpp b/printer.cpp index 5d340055e..e2b88c07e 100644 --- a/printer.cpp +++ b/printer.cpp @@ -30,7 +30,7 @@ void Printer::render() webView->page()->setViewportSize(size); - int Pages = ceil((float)webView->page()->mainFrame()->contentsSize().rheight() / A4_300DPI_HIGHT); + int Pages = ceil(getTotalWork() / 2.0); for (int i = 0; i < Pages; i++) { webView->page()->mainFrame()->render(&painter, QWebFrame::ContentsLayer); webView->page()->mainFrame()->scroll(0, A4_300DPI_HIGHT); -- cgit v1.2.3-70-g09d2