add line or polygon features only if vertex count is >= 2

git-svn-id: http://svn.osgeo.org/qgis/trunk@7083 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
mhugent 2007-07-21 07:38:52 +00:00
parent d45a6c840c
commit 35591523d2

View File

@ -223,6 +223,13 @@ void QgsMapToolAddFeature::canvasReleaseEvent(QMouseEvent * e)
delete mRubberBand;
mRubberBand = NULL;
//bail out if there are not at least two vertices
if(mCaptureList.size() < 2)
{
mCaptureList.clear();
return;
}
//create QgsFeature with wkb representation
QgsFeature* f = new QgsFeature(0,"WKBLineString");
unsigned char* wkb;