Skip to content

Commit 5ec4fef

Browse files
author
Hugo Mercier
committedJun 10, 2014
Inverted polygons: avoid inplace geometry transformation
1 parent 85c57bc commit 5ec4fef

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,11 +183,11 @@ bool QgsInvertedPolygonRenderer::renderFeature( QgsFeature& feature, QgsRenderCo
183183

184184
// update the geometry
185185
CombinedFeature& cFeat = mFeaturesCategories[ mSymbolCategories[catId] ];
186-
QgsGeometry* geom = feature.geometry();
187-
if ( !geom )
186+
if ( !feature.geometry() )
188187
{
189188
return false;
190189
}
190+
QScopedPointer<QgsGeometry> geom( new QgsGeometry( *feature.geometry() ) );
191191

192192
const QgsCoordinateTransform* xform = context.coordinateTransform();
193193
if ( xform )
@@ -206,7 +206,7 @@ bool QgsInvertedPolygonRenderer::renderFeature( QgsFeature& feature, QgsRenderCo
206206
else
207207
{
208208
// other features: combine them (union)
209-
QgsGeometry* combined = cFeat.feature.geometry()->combine( geom );
209+
QgsGeometry* combined = cFeat.feature.geometry()->combine( geom.data() );
210210
if ( combined && combined->isGeosValid() )
211211
{
212212
cFeat.feature.setGeometry( combined );

0 commit comments

Comments
 (0)
Please sign in to comment.