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.
  • Loading branch information
wonder-sk committed Jan 27, 2019
1 parent bba67ae commit dd97201
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/app/vertextool/qgsvertextool.cpp
Expand Up @@ -676,10 +676,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 dd97201

Please sign in to comment.