Skip to content
Permalink
Browse files

Change height calculation in composer html

  • Loading branch information
mhugent committed Oct 4, 2012
1 parent 7b4a9b6 commit 890ec775af9bd3493db72b10db0e078d437f676c
Showing with 2 additions and 8 deletions.
  1. +2 −8 src/core/composer/qgscomposerhtml.cpp
@@ -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();

0 comments on commit 890ec77

Please sign in to comment.
You can’t perform that action at this time.