Skip to content

Commit

Permalink
test geometry validity before applying offset
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Feb 17, 2018
1 parent b0bc2b2 commit cad45c0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/app/qgsmaptooloffsetcurve.cpp
Expand Up @@ -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" ) );
Expand Down

0 comments on commit cad45c0

Please sign in to comment.