Skip to content

Commit

Permalink
Fix crash when rendering clipped features and clipped shape results
Browse files Browse the repository at this point in the history
in promoting a single part geometry to multipart

Fixes #45190
  • Loading branch information
nyalldawson committed Oct 6, 2021
1 parent 19f4d89 commit 6a4cdb3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/symbology/qgssymbol.cpp
Expand Up @@ -1144,15 +1144,15 @@ void QgsSymbol::renderFeature( const QgsFeature &feature, QgsRenderContext &cont

case QgsWkbTypes::MultiPoint:
{
const QgsMultiPoint *mp = qgsgeometry_cast< const QgsMultiPoint * >( part );
const QgsMultiPoint *mp = qgsgeometry_cast< const QgsMultiPoint * >( processedGeometry );
markers.reserve( mp->numGeometries() );
}
FALLTHROUGH
case QgsWkbTypes::MultiCurve:
case QgsWkbTypes::MultiLineString:
case QgsWkbTypes::GeometryCollection:
{
const QgsGeometryCollection *geomCollection = qgsgeometry_cast<const QgsGeometryCollection *>( part );
const QgsGeometryCollection *geomCollection = qgsgeometry_cast<const QgsGeometryCollection *>( processedGeometry );

const unsigned int num = geomCollection->numGeometries();
for ( unsigned int i = 0; i < num; ++i )
Expand All @@ -1176,7 +1176,7 @@ void QgsSymbol::renderFeature( const QgsFeature &feature, QgsRenderContext &cont

QPolygonF pts;

const QgsGeometryCollection *geomCollection = dynamic_cast<const QgsGeometryCollection *>( part );
const QgsGeometryCollection *geomCollection = dynamic_cast<const QgsGeometryCollection *>( processedGeometry );
const unsigned int num = geomCollection->numGeometries();

// Sort components by approximate area (probably a bit faster than using
Expand Down

0 comments on commit 6a4cdb3

Please sign in to comment.