Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 17ed363
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/app/qgsmaptooladdfeature.cpp
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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 );
Expand Down Expand Up @@ -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 );
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 17ed363

Please sign in to comment.