Skip to content

Commit cf2ffef

Browse files
committedJan 29, 2013
(notes and micro-cleanup)
1 parent 820ff2f commit cf2ffef

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed
 

‎src/core/composer/qgscomposerlabel.cpp

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,24 +59,17 @@ void QgsComposerLabel::paint( QPainter* painter, const QStyleOptionGraphicsItem*
5959
if( mHtmlState )
6060
{
6161
painter->scale( 1.0 / mHtmlUnitsToMM, 1.0 / mHtmlUnitsToMM );
62-
//painter->translate( 0.0, -renderExtent.top() * mHtmlUnitsToMM );
62+
6363
QWebPage* webPage = new QWebPage();
64-
/*
65-
TODO : http://blog.qt.digia.com/blog/2009/06/30/transparent-qwebview-or-qwebpage/
66-
is it possible ?
67-
*/
6864
webPage->setViewportSize( QSize(painterRect.width() * mHtmlUnitsToMM, painterRect.height() * mHtmlUnitsToMM) );
6965
webPage->mainFrame()->setScrollBarPolicy( Qt::Horizontal, Qt::ScrollBarAlwaysOff );
7066
webPage->mainFrame()->setScrollBarPolicy( Qt::Vertical, Qt::ScrollBarAlwaysOff );
7167
webPage->mainFrame()->setHtml( displayText() );
72-
webPage->mainFrame()->render( painter );
73-
//webPage->mainFrame()->render( painter, QRegion( painterRect.left(), painterRect.top() * mHtmlUnitsToMM, painterRect.width(), painterRect.height() ) );
74-
//webPage->mainFrame()->render( painter, QRegion( painterRect.left(), painterRect.top() * mHtmlUnitsToMM, painterRect.width() * mHtmlUnitsToMM, painterRect.height() * mHtmlUnitsToMM ) );
75-
//DELETE WEBPAGE ?
68+
webPage->mainFrame()->render( painter );//DELETE WEBPAGE ?
7669
}
7770
else
7871
{
79-
painter->setPen( QPen( QColor( mFontColor ) ) ); //draw all text black
72+
painter->setPen( QPen( QColor( mFontColor ) ) );
8073
painter->setFont( mFont );
8174

8275
QFontMetricsF fontSize( mFont );
@@ -106,6 +99,7 @@ double QgsComposerLabel::htmlUnitsToMM()
10699
return 1.0;
107100
}
108101

102+
//TODO : fix this more precisely so that the label's default text size is the same with or without "display as html"
109103
return ( mComposition->printResolution() / 96.0 ); //webkit seems to assume a standard dpi of 96
110104
}
111105

0 commit comments

Comments
 (0)
Please sign in to comment.