mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Printing: replace usage of std::ceil()
std::ceil() in printer.cpp throws errors when compiled with mingw, so replace all std::ceil calls with qCeil(). Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
This commit is contained in:
parent
f45fdc8660
commit
cc86479475
1 changed files with 3 additions and 3 deletions
|
@ -207,8 +207,8 @@ void Printer::print()
|
|||
connect(&t, SIGNAL(progressUpdated(int)), this, SLOT(templateProgessUpdated(int)));
|
||||
dpi = printerPtr->resolution();
|
||||
//rendering resolution = selected paper size in inchs * printer dpi
|
||||
pageSize.setHeight(std::ceil(printerPtr->pageRect(QPrinter::Inch).height() * dpi));
|
||||
pageSize.setWidth(std::ceil(printerPtr->pageRect(QPrinter::Inch).width() * dpi));
|
||||
pageSize.setHeight(qCeil(printerPtr->pageRect(QPrinter::Inch).height() * dpi));
|
||||
pageSize.setWidth(qCeil(printerPtr->pageRect(QPrinter::Inch).width() * dpi));
|
||||
webView->page()->setViewportSize(pageSize);
|
||||
webView->page()->mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff);
|
||||
// export border width with at least 1 pixel
|
||||
|
@ -237,7 +237,7 @@ void Printer::print()
|
|||
if (divesPerPage == 0) {
|
||||
flowRender();
|
||||
} else {
|
||||
Pages = ceil(getTotalWork(printOptions) / (float)divesPerPage);
|
||||
Pages = qCeil(getTotalWork(printOptions) / (float)divesPerPage);
|
||||
render(Pages);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue