Skip to content

Commit

Permalink
added a kind of oversampling for labels when rendered as HTML
Browse files Browse the repository at this point in the history
  • Loading branch information
olivierdalang committed Feb 6, 2013
1 parent c5ea64e commit ec634a2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/core/composer/qgscomposerlabel.cpp
Expand Up @@ -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();

Expand All @@ -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() );
Expand Down

0 comments on commit ec634a2

Please sign in to comment.