diff options
author | Lubomir I. Ivanov <neolit123@gmail.com> | 2014-07-25 03:50:42 +0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-07-24 21:06:49 -0700 |
commit | e3dbbfe9f298092f6dedeab0e23ce28b506a3644 (patch) | |
tree | 4c47b71e155d1e9604a783b995f838a4ccbb49b6 /qt-ui | |
parent | 3af7db71c8cbbbcb802561ed2a7f49413362f966 (diff) | |
download | subsurface-e3dbbfe9f298092f6dedeab0e23ce28b506a3644.tar.gz |
PrintLayout: draw the profile to a QImage only on Linux
The QImage fix for the recently reported
"huge-vector-lines-in-PDF-printouts" bug is only needed on Linux.
For Win32 and OSx we can render to vector.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/printlayout.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/qt-ui/printlayout.cpp b/qt-ui/printlayout.cpp index 570bda12c..5a7dd3a9b 100644 --- a/qt-ui/printlayout.cpp +++ b/qt-ui/printlayout.cpp @@ -191,16 +191,21 @@ void PrintLayout::printProfileDives(int divesPerRow, int divesPerColumn) printer->newPage(); } } - QTransform origTransform = painter.transform(); - - QImage image(scaledW, scaledH - tableH - padPT, QImage::Format_ARGB32); - QPainter imgPainter(&image); // draw a profile + QTransform origTransform = painter.transform(); painter.translate((scaledW + padW) * col, (scaledH + padH) * row + yOffsetProfile); profile->plotDive(dive, true); // make sure the profile is actually redrawn +#ifdef Q_OS_LINUX // on Linux there is a vector line bug (big lines in PDF), which forces us to render to QImage + QImage image(scaledW, scaledH - tableH - padPT, QImage::Format_ARGB32); + QPainter imgPainter(&image); + imgPainter.setRenderHint(QPainter::Antialiasing); + imgPainter.setRenderHint(QPainter::SmoothPixmapTransform); profile->render(&imgPainter, QRect(0, 0, scaledW, scaledH - tableH - padPT)); imgPainter.end(); painter.drawImage(image.rect(),image); +#else // for other OS we can try rendering the profile as vector + profile->render(&painter, QRect(0, 0, scaledW, scaledH - tableH - padPT)); +#endif painter.setTransform(origTransform); // draw a table |