Skip to content
Permalink
Browse files
Fix unwanted intersection when polygons are moved on an old geometry …
…(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 2e15c257de9c432fe2bf2c521bc561e2f075a8ee
Showing with 19 additions and 0 deletions.
  1. +19 −0 src/app/vertextool/qgsvertextool.cpp
@@ -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() )
@@ -2340,6 +2358,7 @@ void QgsVertexTool::applyEditsToLayers( QgsVertexTool::VertexEdits &edits )
if ( mVertexEditor )
mVertexEditor->updateEditor( mLockedFeature.get() );
}

}


0 comments on commit 2e15c25

Please sign in to comment.