Rendering options

This commit is contained in:
Jakub Melka
2019-07-06 15:55:37 +02:00
parent 584211bf36
commit 9ed17fc8ca
11 changed files with 241 additions and 24 deletions

View File

@ -347,7 +347,8 @@ PDFDrawWidgetProxy::PDFDrawWidgetProxy(QObject* parent) :
m_controller(nullptr),
m_widget(nullptr),
m_horizontalScrollbar(nullptr),
m_verticalScrollbar(nullptr)
m_verticalScrollbar(nullptr),
m_features(PDFRenderer::Antialiasing | PDFRenderer::TextAntialiasing)
{
m_controller = new PDFDrawSpaceController(this);
connect(m_controller, &PDFDrawSpaceController::drawSpaceChanged, this, &PDFDrawWidgetProxy::update);
@ -549,7 +550,7 @@ void PDFDrawWidgetProxy::draw(QPainter* painter, QRect rect)
// Clear the page space by white color
painter->fillRect(placedRect, Qt::white);
PDFRenderer renderer(m_controller->getDocument(), m_controller->getFontCache(), m_controller->getOptionalContentActivity());
PDFRenderer renderer(m_controller->getDocument(), m_controller->getFontCache(), m_controller->getOptionalContentActivity(), m_features);
QList<PDFRenderError> errors = renderer.render(painter, placedRect, item.pageIndex);
if (!errors.empty())
@ -810,4 +811,18 @@ void PDFDrawWidgetProxy::updateVerticalScrollbarFromOffset()
}
}
PDFRenderer::Features PDFDrawWidgetProxy::getFeatures() const
{
return m_features;
}
void PDFDrawWidgetProxy::setFeatures(PDFRenderer::Features features)
{
if (m_features != features)
{
m_features = features;
emit repaintNeeded();
}
}
} // namespace pdf