Skip to content
Permalink
Browse files

render polygons with outline using drawPath (fixes #13343)

(cherry picked from commit 08185c9)
  • Loading branch information
jef-n committed Oct 29, 2015
1 parent 8b9623d commit c0156fc4210509cd4587a0d45a6e3013a3a840a1
Showing with 10 additions and 5 deletions.
  1. +10 −5 src/core/symbology-ng/qgssymbollayerv2.cpp
@@ -467,7 +467,9 @@ void QgsFillSymbolLayerV2::_renderPolygon( QPainter* p, const QPolygonF& points,
return;
}

if ( rings == NULL )
// polygons outlines are sometimes rendered wrongly with drawPolygon, when
// clipped (see #13343), so use drawPath instead.
if ( !rings && p->pen().style() == Qt::NoPen )
{
// simple polygon without holes
p->drawPolygon( points );
@@ -479,11 +481,14 @@ void QgsFillSymbolLayerV2::_renderPolygon( QPainter* p, const QPolygonF& points,
QPolygonF outerRing = points;
path.addPolygon( outerRing );

QList<QPolygonF>::const_iterator it = rings->constBegin();
for ( ; it != rings->constEnd(); ++it )
if ( rings )
{
QPolygonF ring = *it;
path.addPolygon( ring );
QList<QPolygonF>::const_iterator it = rings->constBegin();
for ( ; it != rings->constEnd(); ++it )
{
QPolygonF ring = *it;
path.addPolygon( ring );
}
}

p->drawPath( path );

0 comments on commit c0156fc

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