Skip to content

Commit

Permalink
Fix todo in QgsMapMouseEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
wonder-sk committed Jan 21, 2015
1 parent 6a080ba commit c391abd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/app/qgsmapmouseevent.cpp
Expand Up @@ -78,6 +78,11 @@ QgsPoint QgsMapMouseEvent::mapPoint( bool* snappedPoint ) const
return mMapPoint;
}

struct EdgesOnlyFilter : public QgsPointLocator::MatchFilter
{
bool acceptMatch( const QgsPointLocator::Match& m ) { return m.hasEdge(); }
};

QList<QgsPoint> QgsMapMouseEvent::snappedSegment( bool* snapped ) const
{
QList<QgsPoint> segment = QList<QgsPoint>();
Expand All @@ -89,7 +94,9 @@ QList<QgsPoint> QgsMapMouseEvent::snappedSegment( bool* snapped ) const
}
else
{
// TODO: run snapToMap with only segments (resp. all hits)
// run snapToMap with only segments
EdgesOnlyFilter filter;
mMapTool->canvas()->snappingUtils()->snapToMap( mMapPoint, &filter );
}

if ( snapped )
Expand Down

0 comments on commit c391abd

Please sign in to comment.