File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -626,8 +626,13 @@ QgsPointLocator::Match QgsNodeTool::snapToEditableLayer( QgsMapMouseEvent *e )
626
626
{
627
627
OneFeatureFilter filterLast ( mLastSnap ->layer (), mLastSnap ->featureId () );
628
628
QgsPointLocator::Match lastMatch = snapUtils->snapToMap ( mapPoint, &filterLast );
629
- if ( lastMatch.isValid () && lastMatch.distance () <= m.distance () )
629
+ // but skip the the previously used feature if it would only snap to segment, while now we have snap to vertex
630
+ // so that if there is a point on a line, it gets priority (as is usual with combined vertex+segment snapping)
631
+ bool matchHasVertexLastHasEdge = m.hasVertex () && lastMatch.hasEdge ();
632
+ if ( lastMatch.isValid () && lastMatch.distance () <= m.distance () && !matchHasVertexLastHasEdge )
633
+ {
630
634
m = lastMatch;
635
+ }
631
636
}
632
637
633
638
snapUtils->setConfig ( oldConfig );
You can’t perform that action at this time.
0 commit comments