Skip to content

Commit 3c23bff

Browse files
authored
Merge pull request #7710 from m-kuhn/fixTheFix
Fix the fix from yesterday
2 parents 3cd6899 + bc3a0c0 commit 3c23bff

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/gui/qgsmaptoolcapture.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,8 @@
4141
QgsMapToolCapture::QgsMapToolCapture( QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget, CaptureMode mode )
4242
: QgsMapToolAdvancedDigitizing( canvas, cadDockWidget )
4343
, mCaptureMode( mode )
44+
, mCaptureModeFromLayer( mode == CaptureNone )
4445
{
45-
mCapturing = false;
46-
4746
mSnapIndicator.reset( new QgsSnapIndicator( canvas ) );
4847

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

9695
void QgsMapToolCapture::currentLayerChanged( QgsMapLayer *layer )
9796
{
98-
if ( mCaptureMode != CaptureNone )
97+
if ( !mCaptureModeFromLayer )
9998
return;
10099

100+
mCaptureMode = CaptureNone;
101+
101102
QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer *>( layer );
102103
if ( !vlayer )
103104
{

src/gui/qgsmaptoolcapture.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ class GUI_EXPORT QgsMapToolCapture : public QgsMapToolAdvancedDigitizing
249249
CaptureMode mCaptureMode;
250250

251251
//! Flag to indicate a map canvas capture operation is taking place
252-
bool mCapturing;
252+
bool mCapturing = false;
253253

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

271+
bool mCaptureModeFromLayer;
272+
271273
std::unique_ptr<QgsSnapIndicator> mSnapIndicator;
272274

273275
/**

0 commit comments

Comments
 (0)