Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
add line or polygon features only if vertex count is >= 2
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@7083 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Jul 21, 2007
1 parent 782dd87 commit ebae297
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/app/qgsmaptooladdfeature.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit ebae297

Please sign in to comment.