Skip to content

Commit ebae297

Browse files
author
mhugent
committed
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
1 parent 782dd87 commit ebae297

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/app/qgsmaptooladdfeature.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,13 @@ void QgsMapToolAddFeature::canvasReleaseEvent(QMouseEvent * e)
223223
delete mRubberBand;
224224
mRubberBand = NULL;
225225

226+
//bail out if there are not at least two vertices
227+
if(mCaptureList.size() < 2)
228+
{
229+
mCaptureList.clear();
230+
return;
231+
}
232+
226233
//create QgsFeature with wkb representation
227234
QgsFeature* f = new QgsFeature(0,"WKBLineString");
228235
unsigned char* wkb;

0 commit comments

Comments
 (0)