Skip to content

Commit 890ec77

Browse files
committed
Change height calculation in composer html
1 parent 7b4a9b6 commit 890ec77

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/core/composer/qgscomposerhtml.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,12 @@ void QgsComposerHtml::setUrl( const QUrl& url )
5959
}
6060

6161
if ( frameCount() < 1 ) return;
62-
//QSize contentsSize = mWebPage->mainFrame()->contentsSize();
6362

64-
QRectF contentRect = this->mFrameItems.at( 0 )->boundingRect();
65-
//there is going to be a little rounding error converting from float to int
66-
QSize contentsSize = QSize(( int )( contentRect.width() * mHtmlUnitsToMM ),
67-
( int )( contentRect.height() * mHtmlUnitsToMM ) );
63+
QSize contentsSize = mWebPage->mainFrame()->contentsSize();
64+
contentsSize.setWidth( mFrameItems.at( 0 )->boundingRect().width() * mHtmlUnitsToMM );
6865
mWebPage->setViewportSize( contentsSize );
69-
70-
//suppress scroll bars always
7166
mWebPage->mainFrame()->setScrollBarPolicy( Qt::Horizontal, Qt::ScrollBarAlwaysOff );
7267
mWebPage->mainFrame()->setScrollBarPolicy( Qt::Vertical, Qt::ScrollBarAlwaysOff );
73-
7468
mSize.setWidth( contentsSize.width() / mHtmlUnitsToMM );
7569
mSize.setHeight( contentsSize.height() / mHtmlUnitsToMM );
7670
recalculateFrameSizes();

0 commit comments

Comments
 (0)