Skip to content
Permalink
Browse files
When digitizing new features, don't delete rubberband image until rea…
…dy to draw finished feature so that user isn't confused by disappearing image while being prompted for feature attributes. Fix for #1124.

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@9397 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
telwertowski committed Sep 24, 2008
1 parent 840930c commit 17ed363e756c0cfb52d60efa9fa743b643bc6c64
Showing with 13 additions and 3 deletions.
  1. +13 −3 src/app/qgsmaptooladdfeature.cpp
@@ -234,19 +234,20 @@ void QgsMapToolAddFeature::canvasReleaseEvent( QMouseEvent * e )

mCapturing = FALSE;

delete mRubberBand;
mRubberBand = NULL;

//lines: bail out if there are not at least two vertices
if ( mTool == CaptureLine && mCaptureList.size() < 2 )
{
delete mRubberBand;
mRubberBand = NULL;
mCaptureList.clear();
return;
}

//polygons: bail out if there are not at least two vertices
if ( mTool == CapturePolygon && mCaptureList.size() < 3 )
{
delete mRubberBand;
mRubberBand = NULL;
mCaptureList.clear();
return;
}
@@ -321,6 +322,9 @@ void QgsMapToolAddFeature::canvasReleaseEvent( QMouseEvent * e )
else
{
QMessageBox::critical( 0, QObject::tr( "Error" ), QObject::tr( "Cannot add feature. Unknown WKB type" ) );
delete mRubberBand;
mRubberBand = NULL;
mCaptureList.clear();
return; //unknown wkbtype
}
f->setGeometryAndOwnership( &wkb[0], size );
@@ -414,6 +418,9 @@ void QgsMapToolAddFeature::canvasReleaseEvent( QMouseEvent * e )
else
{
QMessageBox::critical( 0, QObject::tr( "Error" ), QObject::tr( "Cannot add feature. Unknown WKB type" ) );
delete mRubberBand;
mRubberBand = NULL;
mCaptureList.clear();
return; //unknown wkbtype
}
f->setGeometryAndOwnership( &wkb[0], size );
@@ -453,6 +460,9 @@ void QgsMapToolAddFeature::canvasReleaseEvent( QMouseEvent * e )
delete f;
delete mypDialog;

delete mRubberBand;
mRubberBand = NULL;

// delete the elements of mCaptureList
mCaptureList.clear();
mCanvas->refresh();

0 comments on commit 17ed363

Please sign in to comment.