Skip to content
Permalink
Browse files

Fix reshape map tool

  • Loading branch information
lbartoletti authored and nyalldawson committed Feb 12, 2021
1 parent a31190a commit aa95fd0d71d0da7adfb8ff1b0145d6b2c1dfb47d
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/app/qgsmaptoolreshape.cpp
@@ -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();
@@ -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 );

0 comments on commit aa95fd0

Please sign in to comment.