Skip to content
Permalink
Browse files

test geometry validity before applying offset

  • Loading branch information
3nids committed Feb 17, 2018
1 parent b0bc2b2 commit cad45c0b80fe850961d43aec315b182897f3855f
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/app/qgsmaptooloffsetcurve.cpp
@@ -300,7 +300,13 @@ void QgsMapToolOffsetCurve::applyOffset( const double &offset, const Qt::Keyboar
}
mModifiedGeometry = QgsGeometry::fromPolygonXY( newPoly );
}
}

if ( !mModifiedGeometry.isGeosValid() )
{
emit messageEmitted( tr( "Generated geometry is not valid." ), Qgis::Critical );
// no cancel, allow to continue editing.
return;
}

mLayer->beginEditCommand( tr( "Offset curve" ) );

0 comments on commit cad45c0

Please sign in to comment.
You can’t perform that action at this time.