Skip to content
Permalink
Browse files
Build "multi" only when it's needed
  • Loading branch information
wonder-sk committed Jun 10, 2014
1 parent c547aba commit 1d1eed448e9b2936924aeb0d0b7f3d7044bc589c
Showing with 12 additions and 12 deletions.
  1. +12 −12 src/core/symbology-ng/qgsinvertedpolygonrenderer.cpp
@@ -182,7 +182,6 @@ bool QgsInvertedPolygonRenderer::renderFeature( QgsFeature& feature, QgsRenderCo

// update the geometry
CombinedFeature& cFeat = mFeaturesCategories[ mSymbolCategories[catId] ];
QgsMultiPolygon multi;
QgsGeometry* geom = feature.geometry();
if ( !geom )
{
@@ -195,17 +194,6 @@ bool QgsInvertedPolygonRenderer::renderFeature( QgsFeature& feature, QgsRenderCo
geom->transform( *xform );
}

if (( geom->wkbType() == QGis::WKBPolygon ) ||
( geom->wkbType() == QGis::WKBPolygon25D ) )
{
multi.append( geom->asPolygon() );
}
else if (( geom->wkbType() == QGis::WKBMultiPolygon ) ||
( geom->wkbType() == QGis::WKBMultiPolygon25D ) )
{
multi = geom->asMultiPolygon();
}

if ( mPreprocessingEnabled )
{
// preprocessing
@@ -237,6 +225,18 @@ bool QgsInvertedPolygonRenderer::renderFeature( QgsFeature& feature, QgsRenderCo
// No validity check is done, on purpose, it will be very slow and painting
// operations do not need geometries to be valid

QgsMultiPolygon multi;
if (( geom->wkbType() == QGis::WKBPolygon ) ||
( geom->wkbType() == QGis::WKBPolygon25D ) )
{
multi.append( geom->asPolygon() );
}
else if (( geom->wkbType() == QGis::WKBMultiPolygon ) ||
( geom->wkbType() == QGis::WKBMultiPolygon25D ) )
{
multi = geom->asMultiPolygon();
}

for ( int i = 0; i < multi.size(); i++ )
{
// add the exterior ring as interior ring to the first polygon

0 comments on commit 1d1eed4

Please sign in to comment.