Skip to content

Commit 721856a

Browse files
committedOct 29, 2015
render polygons with outline using drawPath (fixes #13343)
(cherry picked from commit 08185c9)
1 parent 42e9dbe commit 721856a

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed
 

‎src/core/symbology-ng/qgssymbollayerv2.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,9 @@ void QgsFillSymbolLayerV2::_renderPolygon( QPainter* p, const QPolygonF& points,
736736
return;
737737
}
738738

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

751-
QList<QPolygonF>::const_iterator it = rings->constBegin();
752-
for ( ; it != rings->constEnd(); ++it )
753+
if ( rings )
753754
{
754-
QPolygonF ring = *it;
755-
path.addPolygon( ring );
755+
QList<QPolygonF>::const_iterator it = rings->constBegin();
756+
for ( ; it != rings->constEnd(); ++it )
757+
{
758+
QPolygonF ring = *it;
759+
path.addPolygon( ring );
760+
}
756761
}
757762

758763
p->drawPath( path );

0 commit comments

Comments
 (0)
Please sign in to comment.