File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -436,7 +436,7 @@ void QgsVertexTool::cadCanvasPressEvent( QgsMapMouseEvent *e )
436436 }
437437 }
438438
439- if ( !clickedOnHighlightedVertex )
439+ if ( !clickedOnHighlightedVertex && e-> button () == Qt::LeftButton )
440440 setHighlightedVertices ( QList<Vertex>() ); // reset selection
441441 }
442442
@@ -980,6 +980,14 @@ void QgsVertexTool::tryToSelectFeature( QgsMapMouseEvent *e )
980980 {
981981 // we have a feature to select
982982 QPair<QgsVectorLayer *, QgsFeatureId> alternative = mLockedFeatureAlternatives ->alternatives .at ( mLockedFeatureAlternatives ->index );
983+ // keep only corrsesponding vertices
984+ // todo: it might be nice to keep other vertices in memory, so we could select them when switching lokcked feature
985+ QList<Vertex> vertices;
986+ for ( const Vertex &v : qgis::as_const ( mSelectedVertices ) )
987+ if ( v.layer == alternative.first && v.fid == alternative.second )
988+ vertices << v;
989+ setHighlightedVertices ( vertices, ModeReset );
990+
983991 updateVertexEditor ( alternative.first , alternative.second );
984992 }
985993 else
@@ -991,6 +999,7 @@ void QgsVertexTool::tryToSelectFeature( QgsMapMouseEvent *e )
991999 {
9921000 mVertexEditor ->updateEditor ( nullptr );
9931001 }
1002+ setHighlightedVertices ( QList<Vertex>(), ModeReset );
9941003 }
9951004
9961005 // we have either locked ourselves to a feature or unlocked again
You can’t perform that action at this time.
0 commit comments