Skip to content

Commit

Permalink
Fix unwanted intersection when polygons are moved on an old geometry …
Browse files Browse the repository at this point in the history
…(moved too). This is done by first moving the vertices and edges and then applying avoidance.
  • Loading branch information
lbartoletti committed May 17, 2021
1 parent 49a2457 commit 2e15c25
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/app/vertextool/qgsvertextool.cpp
Expand Up @@ -2306,6 +2306,24 @@ void QgsVertexTool::applyEditsToLayers( QgsVertexTool::VertexEdits &edits )
layer->beginEditCommand( tr( "Moved vertex" ) );
QHash<QgsFeatureId, QgsGeometry>::iterator it2 = layerEdits.begin();
for ( ; it2 != layerEdits.end(); ++it2 )
{
QgsGeometry featGeom = it2.value();
layer->changeGeometry( it2.key(), featGeom );
edits[layer][it2.key()] = featGeom;
}

if ( mVertexEditor )
mVertexEditor->updateEditor( mLockedFeature.get() );
}



for ( it = edits.begin() ; it != edits.end(); ++it )
{
QgsVectorLayer *layer = it.key();
QHash<QgsFeatureId, QgsGeometry> &layerEdits = it.value();
QHash<QgsFeatureId, QgsGeometry>::iterator it2 = layerEdits.begin();
for ( ; it2 != layerEdits.end(); ++it2 )
{
QList<QgsVectorLayer *> avoidIntersectionsLayers;
switch ( QgsProject::instance()->avoidIntersectionsMode() )
Expand Down Expand Up @@ -2340,6 +2358,7 @@ void QgsVertexTool::applyEditsToLayers( QgsVertexTool::VertexEdits &edits )
if ( mVertexEditor )
mVertexEditor->updateEditor( mLockedFeature.get() );
}

}


Expand Down

0 comments on commit 2e15c25

Please sign in to comment.