Skip to content
Permalink
Browse files
added a kind of oversampling for labels when rendered as HTML
  • Loading branch information
olivierdalang committed Feb 6, 2013
1 parent c5ea64e commit ec634a2d2f90dd0d2669f9f9ddccf946c009ad64
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/core/composer/qgscomposerlabel.cpp
@@ -58,7 +58,7 @@ void QgsComposerLabel::paint( QPainter* painter, const QStyleOptionGraphicsItem*

if( mHtmlState )
{
painter->scale( 1.0 / mHtmlUnitsToMM, 1.0 / mHtmlUnitsToMM );
painter->scale( 1.0 / mHtmlUnitsToMM / 10.0, 1.0 / mHtmlUnitsToMM / 10.0 );

QWebPage* webPage = new QWebPage();

@@ -68,7 +68,8 @@ void QgsComposerLabel::paint( QPainter* painter, const QStyleOptionGraphicsItem*
webPage->setPalette(palette);
//webPage->setAttribute(Qt::WA_OpaquePaintEvent, false); //this does not compile, why ?

webPage->setViewportSize( QSize(painterRect.width() * mHtmlUnitsToMM, painterRect.height() * mHtmlUnitsToMM) );
webPage->setViewportSize( QSize(painterRect.width() * mHtmlUnitsToMM * 10.0, painterRect.height() * mHtmlUnitsToMM * 10.0) );
webPage->mainFrame()->setZoomFactor( 10.0 );
webPage->mainFrame()->setScrollBarPolicy( Qt::Horizontal, Qt::ScrollBarAlwaysOff );
webPage->mainFrame()->setScrollBarPolicy( Qt::Vertical, Qt::ScrollBarAlwaysOff );
webPage->mainFrame()->setHtml( displayText() );

0 comments on commit ec634a2

Please sign in to comment.