Skip to content
Permalink
Browse files

Fix display of overview marker symbol

  • Loading branch information
mhugent committed Jul 11, 2012
1 parent d53ad86 commit ea2f74ab70cc4407677a134e9664fb505d5266c5
Showing with 3 additions and 17 deletions.
  1. +3 −17 src/core/composer/qgscomposermap.cpp
@@ -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()

0 comments on commit ea2f74a

Please sign in to comment.
You can’t perform that action at this time.