Annotations in preview

This commit is contained in:
Jakub Melka
2020-04-11 13:56:05 +02:00
parent 0efc4bb40b
commit dc7dd8fe74
12 changed files with 300 additions and 90 deletions

View File

@ -23,6 +23,7 @@
#include "pdfcompiler.h"
#include "pdfconstants.h"
#include "pdfcms.h"
#include "pdfannotation.h"
#include <QPainter>
#include <QFontMetrics>
@ -394,6 +395,7 @@ PDFDrawWidgetProxy::PDFDrawWidgetProxy(QObject* parent) :
m_textLayoutCompiler(new PDFAsynchronousTextLayoutCompiler(this)),
m_rasterizer(new PDFRasterizer(this)),
m_progress(nullptr),
m_annotationManager(nullptr),
m_useOpenGL(false)
{
m_controller = new PDFDrawSpaceController(this);
@ -824,7 +826,7 @@ QImage PDFDrawWidgetProxy::drawThumbnailImage(PDFInteger pageIndex, int pixelSiz
if (compiledPage && compiledPage->isValid())
{
// Rasterize the image.
image = m_rasterizer->render(page, compiledPage, imageSize, m_features);
image = m_rasterizer->render(pageIndex, page, compiledPage, imageSize, m_features, m_annotationManager);
}
if (image.isNull())
@ -1286,6 +1288,16 @@ void PDFDrawWidgetProxy::updateVerticalScrollbarFromOffset()
}
}
PDFWidgetAnnotationManager* PDFDrawWidgetProxy::getAnnotationManager() const
{
return m_annotationManager;
}
void PDFDrawWidgetProxy::setAnnotationManager(PDFWidgetAnnotationManager* annotationManager)
{
m_annotationManager = annotationManager;
}
PDFRenderer::Features PDFDrawWidgetProxy::getFeatures() const
{
return m_features;