Skip to content

Commit

Permalink
Change height calculation in composer html
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Oct 4, 2012
1 parent 7b4a9b6 commit 890ec77
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/core/composer/qgscomposerhtml.cpp
Expand Up @@ -59,18 +59,12 @@ void QgsComposerHtml::setUrl( const QUrl& url )
}

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

QRectF contentRect = this->mFrameItems.at( 0 )->boundingRect();
//there is going to be a little rounding error converting from float to int
QSize contentsSize = QSize(( int )( contentRect.width() * mHtmlUnitsToMM ),
( int )( contentRect.height() * mHtmlUnitsToMM ) );
QSize contentsSize = mWebPage->mainFrame()->contentsSize();
contentsSize.setWidth( mFrameItems.at( 0 )->boundingRect().width() * mHtmlUnitsToMM );
mWebPage->setViewportSize( contentsSize );

//suppress scroll bars always
mWebPage->mainFrame()->setScrollBarPolicy( Qt::Horizontal, Qt::ScrollBarAlwaysOff );
mWebPage->mainFrame()->setScrollBarPolicy( Qt::Vertical, Qt::ScrollBarAlwaysOff );

mSize.setWidth( contentsSize.width() / mHtmlUnitsToMM );
mSize.setHeight( contentsSize.height() / mHtmlUnitsToMM );
recalculateFrameSizes();
Expand Down

0 comments on commit 890ec77

Please sign in to comment.