Skip to content

Commit

Permalink
Merge pull request #7710 from m-kuhn/fixTheFix
Browse files Browse the repository at this point in the history
Fix the fix from yesterday
  • Loading branch information
m-kuhn committed Aug 26, 2018
2 parents 3cd6899 + bc3a0c0 commit 3c23bff
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/gui/qgsmaptoolcapture.cpp
Expand Up @@ -41,9 +41,8 @@
QgsMapToolCapture::QgsMapToolCapture( QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget, CaptureMode mode )
: QgsMapToolAdvancedDigitizing( canvas, cadDockWidget )
, mCaptureMode( mode )
, mCaptureModeFromLayer( mode == CaptureNone )
{
mCapturing = false;

mSnapIndicator.reset( new QgsSnapIndicator( canvas ) );

setCursor( QgsApplication::getThemeCursor( QgsApplication::Cursor::CapturePoint ) );
Expand Down Expand Up @@ -95,9 +94,11 @@ void QgsMapToolCapture::validationFinished()

void QgsMapToolCapture::currentLayerChanged( QgsMapLayer *layer )
{
if ( mCaptureMode != CaptureNone )
if ( !mCaptureModeFromLayer )
return;

mCaptureMode = CaptureNone;

QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer *>( layer );
if ( !vlayer )
{
Expand Down
4 changes: 3 additions & 1 deletion src/gui/qgsmaptoolcapture.h
Expand Up @@ -249,7 +249,7 @@ class GUI_EXPORT QgsMapToolCapture : public QgsMapToolAdvancedDigitizing
CaptureMode mCaptureMode;

//! Flag to indicate a map canvas capture operation is taking place
bool mCapturing;
bool mCapturing = false;

//! Rubber band for polylines and polygons
QgsRubberBand *mRubberBand = nullptr;
Expand All @@ -268,6 +268,8 @@ class GUI_EXPORT QgsMapToolCapture : public QgsMapToolAdvancedDigitizing
QList< QgsGeometry::Error > mGeomErrors;
QList< QgsVertexMarker * > mGeomErrorMarkers;

bool mCaptureModeFromLayer;

std::unique_ptr<QgsSnapIndicator> mSnapIndicator;

/**
Expand Down

0 comments on commit 3c23bff

Please sign in to comment.