Bugfix: Wrong translation and clip box in case of 270° rotation

This commit is contained in:
Jakub Melka 2019-09-29 19:04:57 +02:00
parent 024c613171
commit 64476910f3
2 changed files with 5 additions and 1 deletions

View File

@ -42,7 +42,7 @@ PDFPainter::PDFPainter(QPainter* painter,
if (features.testFlag(PDFRenderer::ClipToCropBox))
{
QRectF cropBox = page->getRotatedCropBox();
QRectF cropBox = page->getCropBox();
if (cropBox.isValid())
{
QPainterPath path;
@ -366,4 +366,7 @@ bool PDFPainter::canSetBlendMode(BlendMode mode) const
return std::all_of(m_transparencyGroupDataStack.cbegin(), m_transparencyGroupDataStack.cend(), [](const PDFTransparencyGroupPainterData& group) { return group.blendMode == BlendMode::Normal || group.blendMode == BlendMode::Compatible; });
}
// TODO: Check all graphic state parameter dictionaries, warn about missing ones
// TODO: Recompile libraries in MSVC 2019
} // namespace pdf

View File

@ -75,6 +75,7 @@ QList<PDFRenderError> PDFRenderer::render(QPainter* painter, const QRectF& recta
{
matrix.translate(rectangle.right(), rectangle.top());
matrix.rotate(-90);
matrix.translate(-rectangle.height(), 0);
matrix.scale(rectangle.width() / mediaBox.width(), -rectangle.height() / mediaBox.height());
break;
}