Skip to content

Commit

Permalink
Fix for bug #1570, move vertex after add vertex introduces new vertic…
Browse files Browse the repository at this point in the history
…es when snapping is active

git-svn-id: http://svn.osgeo.org/qgis/trunk@10517 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Apr 9, 2009
1 parent 5526c6a commit fa45125
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src/app/qgsmaptooladdvertex.cpp
Expand Up @@ -96,7 +96,25 @@ void QgsMapToolAddVertex::canvasReleaseEvent( QMouseEvent * e )
int topologicalEditing = QgsProject::instance()->readNumEntry( "Digitizing", "/TopologicalEditing", 0 );
if ( topologicalEditing )
{
insertSegmentVerticesForSnap( snapResults, vlayer );
//ignore the snapping results that are on features / segments already considered in mRecentSnappingResults
QList<QgsSnappingResult> filteredSnapResults = snapResults;
QList<QgsSnappingResult>::iterator recentIt = mRecentSnappingResults.begin();
for(; recentIt != mRecentSnappingResults.end(); ++recentIt)
{
QList<QgsSnappingResult>::iterator filterIt = filteredSnapResults.begin();
for(; filterIt != filteredSnapResults.end(); ++filterIt)
{
if(filterIt->snappedAtGeometry == recentIt->snappedAtGeometry \
&& filterIt->snappedVertexNr == recentIt->snappedVertexNr \
&& filterIt->beforeVertexNr == recentIt->beforeVertexNr )
{
filteredSnapResults.erase(filterIt);
continue;
}

}
}
insertSegmentVerticesForSnap( filteredSnapResults, vlayer );
}

snappedPointMapCoord = snapPointFromResults( snapResults, e->pos() );
Expand Down

0 comments on commit fa45125

Please sign in to comment.