Skip to content

Commit

Permalink
[composer] Fix overview extent not being drawn on composer outputs if…
Browse files Browse the repository at this point in the history
… map is set to Rectangle preview mode
  • Loading branch information
nyalldawson committed Dec 15, 2013
1 parent 98d7a02 commit 27bea19
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions src/core/composer/qgscomposermap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,17 +423,16 @@ void QgsComposerMap::paint( QPainter* painter, const QStyleOptionGraphicsItem* i
{
drawGrid( painter );
}
if ( mOverviewFrameMapId != -1 )
{
drawOverviewMapExtent( painter );
}
drawFrame( painter );
if ( isSelected() )
{
drawSelectionBoxes( painter );
}

if ( mOverviewFrameMapId != -1 )
{
drawOverviewMapExtent( painter );
}

painter->restore();
}

Expand Down Expand Up @@ -2186,6 +2185,13 @@ void QgsComposerMap::drawOverviewMapExtent( QPainter* p )
return;
}

if ( mComposition->plotStyle() == QgsComposition::Preview && mPreviewMode == Rectangle )
{
//if map item is set to rectangle preview mode and we are not exporting the composition
//then don't draw an overview rectangle
return;
}

const QgsComposerMap* overviewFrameMap = mComposition->getComposerMapById( mOverviewFrameMapId );
if ( !overviewFrameMap )
{
Expand All @@ -2199,15 +2205,8 @@ void QgsComposerMap::drawOverviewMapExtent( QPainter* p )

QgsRenderContext context;
context.setPainter( p );
if ( mPreviewMode == Rectangle )
{
return;
}
else
{
context.setScaleFactor( 1.0 );
context.setRasterScaleFactor( mComposition->printResolution() / 25.4 );
}
context.setScaleFactor( 1.0 );
context.setRasterScaleFactor( mComposition->printResolution() / 25.4 );

p->save();
p->setCompositionMode( mOverviewBlendMode );
Expand Down

0 comments on commit 27bea19

Please sign in to comment.