Skip to content

Commit 27bea19

Browse files
committed
[composer] Fix overview extent not being drawn on composer outputs if map is set to Rectangle preview mode
1 parent 98d7a02 commit 27bea19

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

src/core/composer/qgscomposermap.cpp

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -423,17 +423,16 @@ void QgsComposerMap::paint( QPainter* painter, const QStyleOptionGraphicsItem* i
423423
{
424424
drawGrid( painter );
425425
}
426+
if ( mOverviewFrameMapId != -1 )
427+
{
428+
drawOverviewMapExtent( painter );
429+
}
426430
drawFrame( painter );
427431
if ( isSelected() )
428432
{
429433
drawSelectionBoxes( painter );
430434
}
431435

432-
if ( mOverviewFrameMapId != -1 )
433-
{
434-
drawOverviewMapExtent( painter );
435-
}
436-
437436
painter->restore();
438437
}
439438

@@ -2186,6 +2185,13 @@ void QgsComposerMap::drawOverviewMapExtent( QPainter* p )
21862185
return;
21872186
}
21882187

2188+
if ( mComposition->plotStyle() == QgsComposition::Preview && mPreviewMode == Rectangle )
2189+
{
2190+
//if map item is set to rectangle preview mode and we are not exporting the composition
2191+
//then don't draw an overview rectangle
2192+
return;
2193+
}
2194+
21892195
const QgsComposerMap* overviewFrameMap = mComposition->getComposerMapById( mOverviewFrameMapId );
21902196
if ( !overviewFrameMap )
21912197
{
@@ -2199,15 +2205,8 @@ void QgsComposerMap::drawOverviewMapExtent( QPainter* p )
21992205

22002206
QgsRenderContext context;
22012207
context.setPainter( p );
2202-
if ( mPreviewMode == Rectangle )
2203-
{
2204-
return;
2205-
}
2206-
else
2207-
{
2208-
context.setScaleFactor( 1.0 );
2209-
context.setRasterScaleFactor( mComposition->printResolution() / 25.4 );
2210-
}
2208+
context.setScaleFactor( 1.0 );
2209+
context.setRasterScaleFactor( mComposition->printResolution() / 25.4 );
22112210

22122211
p->save();
22132212
p->setCompositionMode( mOverviewBlendMode );

0 commit comments

Comments
 (0)