Skip to content

Commit c0156fc

Browse files
committed
render polygons with outline using drawPath (fixes #13343)
(cherry picked from commit 08185c9)
1 parent 8b9623d commit c0156fc

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
@@ -467,7 +467,9 @@ void QgsFillSymbolLayerV2::_renderPolygon( QPainter* p, const QPolygonF& points,
467467
return;
468468
}
469469

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

482-
QList<QPolygonF>::const_iterator it = rings->constBegin();
483-
for ( ; it != rings->constEnd(); ++it )
484+
if ( rings )
484485
{
485-
QPolygonF ring = *it;
486-
path.addPolygon( ring );
486+
QList<QPolygonF>::const_iterator it = rings->constBegin();
487+
for ( ; it != rings->constEnd(); ++it )
488+
{
489+
QPolygonF ring = *it;
490+
path.addPolygon( ring );
491+
}
487492
}
488493

489494
p->drawPath( path );

0 commit comments

Comments
 (0)