Skip to content
Permalink
Browse files

Render method for composer html

  • Loading branch information
mhugent committed Jul 25, 2012
1 parent 4f52d9f commit 5135fe872a8b7c0744f9c2c868d2286cee75ad90
Showing with 12 additions and 1 deletion.
  1. +12 −1 src/core/composer/qgscomposerhtml.cpp
@@ -46,6 +46,7 @@ void QgsComposerHtml::setUrl( const QUrl& url )
{
qApp->processEvents();
}
mWebPage->setViewportSize( mWebPage->mainFrame()->contentsSize() );
}

void QgsComposerHtml::frameLoaded( bool ok )
@@ -60,5 +61,15 @@ QSizeF QgsComposerHtml::totalSize() const

void QgsComposerHtml::render( QPainter* p, const QRectF& renderExtent )
{
//soon...
if ( !mWebPage )
{
return;
}

double pixelPerMM = mComposition->printResolution() / 25.4;
double painterScale = 1.0 / ( pixelPerMM / (( double )mImage->dotsPerMeterX() / 1000.0 ) );
painter->save();
painter->scale( painterScale, painterScale );
mWebPage->mainFrame()->render( p, QRegion( renderExtent.left(), renderExtent.top(), renderExtent.width(), renderExtent.height() ) );
painter->restore();
}

0 comments on commit 5135fe8

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