DocPage Organizer: Preview image painting

This commit is contained in:
Jakub Melka
2021-07-25 18:00:08 +02:00
parent 4570b12359
commit 7cc02ae51c
5 changed files with 111 additions and 5 deletions

View File

@ -48,12 +48,22 @@ PDFRenderer::PDFRenderer(const PDFDocument* document,
Q_ASSERT(document);
}
QMatrix PDFRenderer::createPagePointToDevicePointMatrix(const PDFPage* page, const QRectF& rectangle)
QMatrix PDFRenderer::createPagePointToDevicePointMatrix(const PDFPage* page,
const QRectF& rectangle,
PageRotation extraRotation)
{
QRectF mediaBox = page->getRotatedMediaBox();
PageRotation pageRotation = getPageRotationCombined(page->getPageRotation(), extraRotation);
QRectF mediaBox = page->getRotatedBox(page->getMediaBox(), pageRotation);
return createMediaBoxToDevicePointMatrix(mediaBox, rectangle, pageRotation);
}
QMatrix PDFRenderer::createMediaBoxToDevicePointMatrix(const QRectF& mediaBox,
const QRectF& rectangle,
PageRotation rotation)
{
QMatrix matrix;
switch (page->getPageRotation())
switch (rotation)
{
case PageRotation::None:
{