Skip to content
Browse files
[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 dd97201d1b08edb3e451a8bb8e0af4203793c034
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/app/vertextool/qgsvertextool.cpp
@@ -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

0 comments on commit dd97201

Please sign in to comment.