mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
3af7db71c8
commit
e3dbbfe9f2
1 changed files with 9 additions and 4 deletions
|
@ -191,16 +191,21 @@ void PrintLayout::printProfileDives(int divesPerRow, int divesPerColumn)
|
||||||
printer->newPage();
|
printer->newPage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
QTransform origTransform = painter.transform();
|
|
||||||
|
|
||||||
QImage image(scaledW, scaledH - tableH - padPT, QImage::Format_ARGB32);
|
|
||||||
QPainter imgPainter(&image);
|
|
||||||
// draw a profile
|
// draw a profile
|
||||||
|
QTransform origTransform = painter.transform();
|
||||||
painter.translate((scaledW + padW) * col, (scaledH + padH) * row + yOffsetProfile);
|
painter.translate((scaledW + padW) * col, (scaledH + padH) * row + yOffsetProfile);
|
||||||
profile->plotDive(dive, true); // make sure the profile is actually redrawn
|
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));
|
profile->render(&imgPainter, QRect(0, 0, scaledW, scaledH - tableH - padPT));
|
||||||
imgPainter.end();
|
imgPainter.end();
|
||||||
painter.drawImage(image.rect(),image);
|
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);
|
painter.setTransform(origTransform);
|
||||||
|
|
||||||
// draw a table
|
// draw a table
|
||||||
|
|
Loading…
Add table
Reference in a new issue