From af55e1aac22126f72f738a666db01c8a146d99dc Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Thu, 3 Jan 2019 14:09:21 +0100 Subject: removed dep on fmin() --- src/data/pdfdocument.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/data') diff --git a/src/data/pdfdocument.cpp b/src/data/pdfdocument.cpp index 9b213b2..c9574b8 100644 --- a/src/data/pdfdocument.cpp +++ b/src/data/pdfdocument.cpp @@ -39,9 +39,11 @@ void PdfDocument::renderTo(QLabel *label, QRect rect) //QRect rect = ui->scrollArea->visibleRegion().boundingRect(); int w = static_cast(ratio * (rect.width() - 20)); int h = static_cast(ratio * (rect.height() - 20)); - qreal scale = fmin(static_cast(w) / pageSize.width(), - static_cast(h) / pageSize.height()); + // not all platforms have fmin, compute the min by hand + qreal hscale = static_cast(w) / pageSize.width(); + qreal vscale = static_cast(h) / pageSize.height(); + qreal scale = (hscale < vscale) ? hscale : vscale; int dpi = static_cast(scale * 72.0); int w1 = static_cast(scale * pageSize.width()); -- cgit v1.2.3