File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -88,7 +88,17 @@ void QgsComposerHtml::loadHtml()
88
88
if ( frameCount () < 1 ) return ;
89
89
90
90
QSize contentsSize = mWebPage ->mainFrame ()->contentsSize ();
91
- contentsSize.setWidth ( mFrameItems .at ( 0 )->boundingRect ().width () * mHtmlUnitsToMM );
91
+
92
+ // find maximum frame width
93
+ double maxFrameWidth = 0 ;
94
+ QList<QgsComposerFrame*>::const_iterator frameIt = mFrameItems .constBegin ();
95
+ for ( ; frameIt != mFrameItems .constEnd (); ++frameIt )
96
+ {
97
+ maxFrameWidth = qMax ( maxFrameWidth, ( *frameIt )->boundingRect ().width () );
98
+ }
99
+ // set content width to match maximum frame width
100
+ contentsSize.setWidth ( maxFrameWidth * mHtmlUnitsToMM );
101
+
92
102
mWebPage ->setViewportSize ( contentsSize );
93
103
mWebPage ->mainFrame ()->setScrollBarPolicy ( Qt::Horizontal, Qt::ScrollBarAlwaysOff );
94
104
mWebPage ->mainFrame ()->setScrollBarPolicy ( Qt::Vertical, Qt::ScrollBarAlwaysOff );
You can’t perform that action at this time.
0 commit comments