Skip to content

Commit ec634a2

Browse files
committedFeb 6, 2013
added a kind of oversampling for labels when rendered as HTML
1 parent c5ea64e commit ec634a2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎src/core/composer/qgscomposerlabel.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ void QgsComposerLabel::paint( QPainter* painter, const QStyleOptionGraphicsItem*
5858

5959
if( mHtmlState )
6060
{
61-
painter->scale( 1.0 / mHtmlUnitsToMM, 1.0 / mHtmlUnitsToMM );
61+
painter->scale( 1.0 / mHtmlUnitsToMM / 10.0, 1.0 / mHtmlUnitsToMM / 10.0 );
6262

6363
QWebPage* webPage = new QWebPage();
6464

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

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

0 commit comments

Comments
 (0)
Please sign in to comment.