diff --git a/src/analysis/vector/qgsgeometrysnappersinglesource.cpp b/src/analysis/vector/qgsgeometrysnappersinglesource.cpp index c849a66745b3..050f6ed2a79f 100644 --- a/src/analysis/vector/qgsgeometrysnappersinglesource.cpp +++ b/src/analysis/vector/qgsgeometrysnappersinglesource.cpp @@ -273,26 +273,26 @@ static bool snapGeometry( QgsAbstractGeometry *g, const QgsSpatialIndex &index, bool changed = false; if ( QgsLineString *linestring = qgsgeometry_cast( g ) ) { - changed |= snapLineString( linestring, index, pnts, thresh ); + changed = snapLineString( linestring, index, pnts, thresh ) | changed; } else if ( QgsPolygon *polygon = qgsgeometry_cast( g ) ) { if ( QgsLineString *exteriorRing = qgsgeometry_cast( polygon->exteriorRing() ) ) - changed |= snapLineString( exteriorRing, index, pnts, thresh ); + changed = snapLineString( exteriorRing, index, pnts, thresh ) | changed; for ( int i = 0; i < polygon->numInteriorRings(); ++i ) { if ( QgsLineString *interiorRing = qgsgeometry_cast( polygon->interiorRing( i ) ) ) - changed |= snapLineString( interiorRing, index, pnts, thresh ); + changed = snapLineString( interiorRing, index, pnts, thresh ) | changed; } } else if ( QgsGeometryCollection *collection = qgsgeometry_cast( g ) ) { for ( int i = 0; i < collection->numGeometries(); ++i ) - changed |= snapGeometry( collection->geometryN( i ), index, pnts, thresh ); + changed = snapGeometry( collection->geometryN( i ), index, pnts, thresh ) | changed; } else if ( QgsPoint *pt = qgsgeometry_cast( g ) ) { - changed |= snapPoint( pt, index, pnts ); + changed = snapPoint( pt, index, pnts ) | changed; } return changed;