Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[vertex tool] Fix issue with hidden layers being editable (fixes #18434)
The problem was that QgsSnappingConfig when initialized from a project
loads global settings from QgsSettings and sets individual layer configs
based on that.

The issue was showing up only in "current layer" mode of vertex tool
because for "all layers" mode all individual layer configs were overwritten.

(cherry picked from commit dd97201)
  • Loading branch information
wonder-sk authored and nyalldawson committed Feb 1, 2019
1 parent f988f6f commit 2ad4719
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/app/vertextool/qgsvertextool.cpp
Expand Up @@ -693,10 +693,11 @@ QgsPointLocator::Match QgsVertexTool::snapToEditableLayer( QgsMapMouseEvent *e )
QgsPointXY mapPoint = toMapCoordinates( e->pos() );
double tol = QgsTolerance::vertexSearchRadius( canvas()->mapSettings() );

QgsSnappingConfig config( QgsProject::instance() );
QgsSnappingConfig config;
config.setEnabled( true );
config.setMode( QgsSnappingConfig::AdvancedConfiguration );
config.setIntersectionSnapping( false ); // only snap to layers
Q_ASSERT( config.individualLayerSettings().isEmpty() );

// if there is a current layer, it should have priority over other layers
// because sometimes there may be match from multiple layers at one location
Expand Down

0 comments on commit 2ad4719

Please sign in to comment.