Skip to content
Permalink
Browse files
[composer] Fix overview extent not being drawn on composer outputs if…
… map is set to Rectangle preview mode
  • Loading branch information
nyalldawson committed Dec 15, 2013
1 parent 98d7a02 commit 27bea199785cebe34fe672d8fc347285ee140d89
Showing with 13 additions and 14 deletions.
  1. +13 −14 src/core/composer/qgscomposermap.cpp
@@ -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();
}

@@ -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 )
{
@@ -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 );

0 comments on commit 27bea19

Please sign in to comment.