File tree 1 file changed +10
-1
lines changed
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -436,7 +436,7 @@ void QgsVertexTool::cadCanvasPressEvent( QgsMapMouseEvent *e )
436
436
}
437
437
}
438
438
439
- if ( !clickedOnHighlightedVertex )
439
+ if ( !clickedOnHighlightedVertex && e-> button () == Qt::LeftButton )
440
440
setHighlightedVertices ( QList<Vertex>() ); // reset selection
441
441
}
442
442
@@ -980,6 +980,14 @@ void QgsVertexTool::tryToSelectFeature( QgsMapMouseEvent *e )
980
980
{
981
981
// we have a feature to select
982
982
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
+
983
991
updateVertexEditor ( alternative.first , alternative.second );
984
992
}
985
993
else
@@ -991,6 +999,7 @@ void QgsVertexTool::tryToSelectFeature( QgsMapMouseEvent *e )
991
999
{
992
1000
mVertexEditor ->updateEditor ( nullptr );
993
1001
}
1002
+ setHighlightedVertices ( QList<Vertex>(), ModeReset );
994
1003
}
995
1004
996
1005
// we have either locked ourselves to a feature or unlocked again
You can’t perform that action at this time.
0 commit comments