Skip to content

Commit

Permalink
Fix display of overview marker symbol
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Jul 11, 2012
1 parent d53ad86 commit ea2f74a
Showing 1 changed file with 3 additions and 17 deletions.
20 changes: 3 additions & 17 deletions src/core/composer/qgscomposermap.cpp
Expand Up @@ -1928,37 +1928,23 @@ void QgsComposerMap::drawOverviewMapExtent( QPainter* p )
{
return;
}
else if ( mComposition->plotStyle() == QgsComposition::Preview )
{
context.setScaleFactor( 1.0 );
context.setRasterScaleFactor( /*96.0*/ mComposition->printResolution() / 25.4 );
}
else //print
else
{
context.setScaleFactor( 1.0 );
double rasterScaleFactor = mComposition->printResolution() / 25.4;
context.setRasterScaleFactor( rasterScaleFactor );
context.setRasterScaleFactor( mComposition->printResolution() / 25.4 );
}

QPolygonF polygon;
double x = ( intersectRect.xMinimum() - thisExtent.xMinimum() ) / thisExtent.width() * rect().width();
double y = ( thisExtent.yMaximum() - intersectRect.yMaximum() ) / thisExtent.height() * rect().height();
double width = intersectRect.width() / thisExtent.width() * rect().width();
double height = intersectRect.height() / thisExtent.height() * rect().height();
polygon << QPointF( x, y ) << QPointF( x + width, y ) << QPointF( x + width, y + height ) << QPointF( x, y + height );
polygon << QPointF( x, y ) << QPointF( x + width, y ) << QPointF( x + width, y + height ) << QPointF( x, y + height ) << QPointF( x, y );

QList<QPolygonF> rings; //empty list
mOverviewFrameMapSymbol->startRender( context );
mOverviewFrameMapSymbol->renderPolygon( polygon, &rings, 0, context );
mOverviewFrameMapSymbol->stopRender( context );

/*p->setPen( QPen( Qt::red ) ); //todo: make appearance configurable
p->setBrush( QBrush( QColor( 255, 0, 0, 100 ) ) );
double x = ( intersectRect.xMinimum() - thisExtent.xMinimum() ) / thisExtent.width() * rect().width();
double y = ( thisExtent.yMaximum() - intersectRect.yMaximum() ) / thisExtent.height() * rect().height();
double width = intersectRect.width() / thisExtent.width() * rect().width();
double height = intersectRect.height() / thisExtent.height() * rect().height();
p->drawRect( QRectF( x, y, width, height ) );*/
}

void QgsComposerMap::createDefaultOverviewFrameSymbol()
Expand Down

0 comments on commit ea2f74a

Please sign in to comment.