mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
Change height calculation in composer html
This commit is contained in:
parent
7b4a9b68a3
commit
890ec775af
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user