File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -103,19 +103,21 @@ void QgsMapToolReshape::cadCanvasReleaseEvent( QgsMapMouseEvent * e )
103
103
// avoid intersections on polygon layers
104
104
if ( vlayer->geometryType () == QGis::Polygon )
105
105
{
106
-
107
106
// ignore all current layer features as they should be reshaped too
108
107
QMap<QgsVectorLayer*, QSet<QgsFeatureId>> ignoreFeatures;
109
108
ignoreFeatures.insert ( vlayer, vlayer->allFeatureIds () );
110
109
111
- int avoidIntersectionsReturn = geom->avoidIntersections ( ignoreFeatures );
112
- if ( avoidIntersectionsReturn == 1 )
110
+ if ( geom->avoidIntersections ( ignoreFeatures ) != 0 )
113
111
{
114
- // not a polygon type. Impossible to get there
112
+ emit messageEmitted ( tr ( " An error was reported during intersection removal" ), QgsMessageBar::CRITICAL );
113
+ vlayer->destroyEditCommand ();
114
+ stopCapturing ();
115
+ return ;
115
116
}
116
- if ( geom->isGeosEmpty () ) // avoid intersection might have removed the whole geometry
117
+
118
+ if ( geom->isGeosEmpty () ) // intersection removal might have removed the whole geometry
117
119
{
118
- emit messageEmitted ( tr ( " The feature cannot be reshaped because resulting geometry is empty" ), QgsMessageBar::CRITICAL );
120
+ emit messageEmitted ( tr ( " The feature cannot be reshaped because the resulting geometry is empty" ), QgsMessageBar::CRITICAL );
119
121
vlayer->destroyEditCommand ();
120
122
stopCapturing ();
121
123
return ;
You can’t perform that action at this time.
0 commit comments