Skip to content
Permalink
Browse files
Fix for #239 - retain outline color of selected polygons
git-svn-id: http://svn.osgeo.org/qgis/trunk@9476 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Oct 14, 2008
1 parent 17c044f commit 16caebc21752e2c28eb69724ceea9c8eb172bd61
@@ -155,7 +155,7 @@ void QgsContinuousColorRenderer::renderFeature( QPainter * p, QgsFeature & f, QI
linePen.setWidthF( widthScale*mMinimumSymbol->pen().widthF() );
p->setPen( linePen );
}
else
else //polygon
{
p->setBrush( QColor( red, green, blue ) );
if ( mDrawPolygonOutline )
@@ -166,15 +166,22 @@ void QgsContinuousColorRenderer::renderFeature( QPainter * p, QgsFeature & f, QI
p->setPen( pen );
}
else
{
p->setPen( Qt::NoPen );
}
}
if ( selected )
{
QPen pen = mMinimumSymbol->pen();
pen.setColor( mSelectionColor );
//for polygons we dont use selection colour for outline
//otherwise adjacent features appear merged when selected
if ( mGeometryType != QGis::Polygon )
{
QPen pen = mMinimumSymbol->pen();
pen.setColor( mSelectionColor );
p->setPen( pen );
}
QBrush brush = mMinimumSymbol->brush();
brush.setColor( mSelectionColor );
p->setPen( pen );
p->setBrush( brush );
}
}
@@ -153,9 +153,7 @@ void QgsGraduatedSymbolRenderer::renderFeature( QPainter * p, QgsFeature & f, QI
else
{
QPen pen = theSymbol->pen();
pen.setColor( mSelectionColor );
pen.setWidthF( widthScale * pen.widthF() );
p->setPen( pen );

if ( mGeometryType == QGis::Polygon )
{
@@ -164,6 +162,11 @@ void QgsGraduatedSymbolRenderer::renderFeature( QPainter * p, QgsFeature & f, QI
brush.setColor( mSelectionColor );
p->setBrush( brush );
}
else //dont draw outlines in selection colour for polys otherwise they appear merged
{
pen.setColor( mSelectionColor );
}
p->setPen( pen );
}
}
}
@@ -137,18 +137,20 @@ void QgsSingleSymbolRenderer::renderFeature( QPainter * p, QgsFeature & f, QImag
{
QPen pen = mSymbol->pen();
pen.setWidthF( widthScale * pen.widthF() );
// We set pen color in case it is an area with no brush (transparent).
// Previously, this was only done for lines. Why?
pen.setColor( mSelectionColor );
p->setPen( pen );

if ( mGeometryType == QGis::Polygon )
{
QBrush brush = mSymbol->brush();
scaleBrush( brush, rasterScaleFactor ); //scale brush content for printout
brush.setColor( mSelectionColor );
p->setBrush( brush );
}
else //for lines we draw in selection color
{
// We set pen color in case it is an area with no brush (transparent).
// Previously, this was only done for lines. Why?
pen.setColor( mSelectionColor );
p->setPen( pen );
}
}
}
}
@@ -162,15 +162,18 @@ void QgsUniqueValueRenderer::renderFeature( QPainter* p, QgsFeature& f, QImage*
{
QPen pen = symbol->pen();
pen.setWidthF( widthScale * pen.widthF() );
pen.setColor( mSelectionColor );
p->setPen( pen );
if ( mGeometryType == QGis::Polygon )
{
QBrush brush = symbol->brush();
scaleBrush( brush, rasterScaleFactor ); //scale brush content for printout
brush.setColor( mSelectionColor );
p->setBrush( brush );
}
else //dont draw outlines of polygons in selection colour otherwise they appear merged
{
pen.setColor( mSelectionColor );
}
p->setPen( pen );
}
}
}

0 comments on commit 16caebc

Please sign in to comment.