Skip to content
Permalink
Browse files

Merge pull request #7710 from m-kuhn/fixTheFix

Fix the fix from yesterday
  • Loading branch information
m-kuhn committed Aug 26, 2018
2 parents 3cd6899 + bc3a0c0 commit 3c23bff68180228cf234df68a62aee6585f48e46
Showing with 7 additions and 4 deletions.
  1. +4 −3 src/gui/qgsmaptoolcapture.cpp
  2. +3 −1 src/gui/qgsmaptoolcapture.h
@@ -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 ) );
@@ -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 )
{
@@ -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;
@@ -268,6 +268,8 @@ class GUI_EXPORT QgsMapToolCapture : public QgsMapToolAdvancedDigitizing
QList< QgsGeometry::Error > mGeomErrors;
QList< QgsVertexMarker * > mGeomErrorMarkers;

bool mCaptureModeFromLayer;

std::unique_ptr<QgsSnapIndicator> mSnapIndicator;

/**

0 comments on commit 3c23bff

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