mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
Snapper, some code for screenshot tool
This commit is contained in:
@@ -402,6 +402,7 @@ PDFPrecompiledPageGenerator::PDFPrecompiledPageGenerator(PDFPrecompiledPage* pre
|
||||
m_precompiledPage(precompiledPage)
|
||||
{
|
||||
m_precompiledPage->setPaperColor(cms->getPaperColor());
|
||||
m_precompiledPage->getSnapInfo()->addPageMediaBox(page->getRotatedMediaBox());
|
||||
}
|
||||
|
||||
void PDFPrecompiledPageGenerator::performPathPainting(const QPainterPath& path, bool stroke, bool fill, bool text, Qt::FillRule fillRule)
|
||||
@@ -428,6 +429,17 @@ void PDFPrecompiledPageGenerator::performImagePainting(const QImage& image)
|
||||
return;
|
||||
}
|
||||
|
||||
// Add snap info for image to the snapper
|
||||
QMatrix matrix = getCurrentWorldMatrix();
|
||||
PDFSnapInfo* snapInfo = m_precompiledPage->getSnapInfo();
|
||||
snapInfo->addImage({
|
||||
matrix.map(QPointF(0.0, 0.0)),
|
||||
matrix.map(QPointF(1.0, 0.0)),
|
||||
matrix.map(QPointF(1.0, 1.0)),
|
||||
matrix.map(QPointF(0.0, 1.0)),
|
||||
matrix.map(QPointF(0.5, 0.5)),
|
||||
});
|
||||
|
||||
if (isTransparencyGroupActive())
|
||||
{
|
||||
PDFReal alpha = getEffectiveFillingAlpha();
|
||||
|
Reference in New Issue
Block a user