Skip to content
Permalink
Browse files

Fix #11426 (Right click cause crash when digitizing polygon inner ring)

Also fixed the same crash for add part and fill ring map tools.
  • Loading branch information
wonder-sk committed Oct 20, 2014
1 parent d11597a commit fb321782bf7ae51ac09fcc8c933660f983c028d3
@@ -115,6 +115,11 @@ void QgsMapToolAddPart::canvasReleaseEvent( QMouseEvent * e )
return;
}

if ( !isCapturing() )
return;

// we are now going to finish the capturing

if ( mode() == CapturePolygon )
{
//close polygon
@@ -72,6 +72,9 @@ void QgsMapToolAddRing::canvasReleaseEvent( QMouseEvent * e )
}
else if ( e->button() == Qt::RightButton )
{
if ( !isCapturing() )
return;

deleteTempRubberBand();

closePolygon();
@@ -268,6 +268,11 @@ void QgsMapToolCapture::startCapturing()
mCapturing = true;
}

bool QgsMapToolCapture::isCapturing() const
{
return mCapturing;
}

void QgsMapToolCapture::stopCapturing()
{
if ( mRubberBand )
@@ -79,6 +79,7 @@ class APP_EXPORT QgsMapToolCapture : public QgsMapToolEdit
void undo();

void startCapturing();
bool isCapturing() const;
void stopCapturing();
void deleteTempRubberBand();

@@ -73,6 +73,9 @@ void QgsMapToolFillRing::canvasReleaseEvent( QMouseEvent * e )
}
else if ( e->button() == Qt::RightButton )
{
if ( !isCapturing() )
return;

deleteTempRubberBand();

closePolygon();

0 comments on commit fb32178

Please sign in to comment.
You can’t perform that action at this time.