Skip to content

Commit

Permalink
Fix reshape map tool
Browse files Browse the repository at this point in the history
  • Loading branch information
lbartoletti authored and nyalldawson committed Feb 12, 2021
1 parent a31190a commit aa95fd0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/app/qgsmaptoolreshape.cpp
Expand Up @@ -175,9 +175,11 @@ void QgsMapToolReshape::reshape( QgsVectorLayer *vlayer )
case QgsProject::AvoidIntersectionsMode::AllowIntersections:
break;
}
int res = -1;
if ( avoidIntersectionsLayers.size() > 0 )
{
if ( geom.avoidIntersections( QgsProject::instance()->avoidIntersectionsLayers(), ignoreFeatures ) != 0 )
res = geom.avoidIntersections( QgsProject::instance()->avoidIntersectionsLayers(), ignoreFeatures );
if ( res == 1 || res == 3 )
{
emit messageEmitted( tr( "An error was reported during intersection removal" ), Qgis::Critical );
vlayer->destroyEditCommand();
Expand All @@ -192,6 +194,10 @@ void QgsMapToolReshape::reshape( QgsVectorLayer *vlayer )
vlayer->destroyEditCommand();
return;
}
if ( res == 2 || res == 4 )
{
emit messageEmitted( tr( "At least one geometry intersected is invalid. You should fix geometries." ), Qgis::Warning );
}
}

vlayer->changeGeometry( f.id(), geom );
Expand Down

0 comments on commit aa95fd0

Please sign in to comment.