File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,11 @@ QgsPoint QgsMapMouseEvent::mapPoint( bool* snappedPoint ) const
78
78
return mMapPoint ;
79
79
}
80
80
81
+ struct EdgesOnlyFilter : public QgsPointLocator ::MatchFilter
82
+ {
83
+ bool acceptMatch ( const QgsPointLocator::Match& m ) { return m.hasEdge (); }
84
+ };
85
+
81
86
QList<QgsPoint> QgsMapMouseEvent::snappedSegment ( bool * snapped ) const
82
87
{
83
88
QList<QgsPoint> segment = QList<QgsPoint>();
@@ -89,7 +94,9 @@ QList<QgsPoint> QgsMapMouseEvent::snappedSegment( bool* snapped ) const
89
94
}
90
95
else
91
96
{
92
- // TODO: run snapToMap with only segments (resp. all hits)
97
+ // run snapToMap with only segments
98
+ EdgesOnlyFilter filter;
99
+ mMapTool ->canvas ()->snappingUtils ()->snapToMap ( mMapPoint , &filter );
93
100
}
94
101
95
102
if ( snapped )
You can’t perform that action at this time.
0 commit comments