Skip to content

Commit

Permalink
Revert "Simplify code"
Browse files Browse the repository at this point in the history
This reverts commit dea911d.
  • Loading branch information
m-kuhn committed Aug 26, 2018
1 parent 3cd6899 commit 43afffc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/gui/qgsmaptoolcapture.cpp
Expand Up @@ -42,6 +42,7 @@ QgsMapToolCapture::QgsMapToolCapture( QgsMapCanvas *canvas, QgsAdvancedDigitizin
: QgsMapToolAdvancedDigitizing( canvas, cadDockWidget )
, mCaptureMode( mode )
{
mCaptureModeFromLayer = mode == CaptureNone;
mCapturing = false;

mSnapIndicator.reset( new QgsSnapIndicator( canvas ) );
Expand Down Expand Up @@ -95,9 +96,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
2 changes: 2 additions & 0 deletions src/gui/qgsmaptoolcapture.h
Expand Up @@ -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 43afffc

Please sign in to comment.