Skip to content

Commit 965a4e8

Browse files
committedFeb 19, 2018
revert adding tolerance to QgsSnappingUtils::snapToCurrentLayer
since it already uses digitizing settings
1 parent 337fa7b commit 965a4e8

File tree

3 files changed

+6
-21
lines changed

3 files changed

+6
-21
lines changed
 

‎python/core/qgssnappingutils.sip.in

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,9 @@ Snap to map according to the current configuration. Optional filter allows disca
5454
QgsPointLocator::Match snapToMap( const QgsPointXY &pointMap, QgsPointLocator::MatchFilter *filter = 0 );
5555

5656

57-
QgsPointLocator::Match snapToCurrentLayer( QPoint point, QgsPointLocator::Types type, QgsPointLocator::MatchFilter *filter = 0, double tolerance = 0.0 );
57+
QgsPointLocator::Match snapToCurrentLayer( QPoint point, QgsPointLocator::Types type, QgsPointLocator::MatchFilter *filter = 0 );
5858
%Docstring
59-
snapToCurrentLayer snap to current layer with given settings
60-
61-
:param point: the point to snap from
62-
:param type: the matching type (vertex, edge, area)
63-
:param filter: the matching filter
64-
:param tolerance: the tolerance in project units. If left to 0, it is calculated from current map settings
65-
66-
:return: the snapping match
59+
Snap to current layer
6760
%End
6861

6962

‎src/core/qgssnappingutils.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -440,14 +440,13 @@ void QgsSnappingUtils::toggleEnabled()
440440
emit configChanged( mSnappingConfig );
441441
}
442442

443-
QgsPointLocator::Match QgsSnappingUtils::snapToCurrentLayer( QPoint point, QgsPointLocator::Types type, QgsPointLocator::MatchFilter *filter, double tolerance )
443+
QgsPointLocator::Match QgsSnappingUtils::snapToCurrentLayer( QPoint point, QgsPointLocator::Types type, QgsPointLocator::MatchFilter *filter )
444444
{
445445
if ( !mCurrentLayer )
446446
return QgsPointLocator::Match();
447447

448448
QgsPointXY pointMap = mMapSettings.mapToPixel().toMapCoordinates( point );
449-
if ( tolerance == 0.0 )
450-
tolerance = QgsTolerance::vertexSearchRadius( mMapSettings );
449+
double tolerance = QgsTolerance::vertexSearchRadius( mMapSettings );
451450

452451
QgsPointLocator *loc = locatorForLayerUsingStrategy( mCurrentLayer, pointMap, tolerance );
453452
if ( !loc )

‎src/core/qgssnappingutils.h

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,8 @@ class CORE_EXPORT QgsSnappingUtils : public QObject
6767

6868
//! Snap to current layer
6969

70-
/**
71-
* \brief snapToCurrentLayer snap to current layer with given settings
72-
* \param point the point to snap from
73-
* \param type the matching type (vertex, edge, area)
74-
* \param filter the matching filter
75-
* \param tolerance the tolerance in project units. If left to 0, it is calculated from current map settings
76-
* \return the snapping match
77-
*/
78-
QgsPointLocator::Match snapToCurrentLayer( QPoint point, QgsPointLocator::Types type, QgsPointLocator::MatchFilter *filter = nullptr, double tolerance = 0.0 );
70+
//! Snap to current layer
71+
QgsPointLocator::Match snapToCurrentLayer( QPoint point, QgsPointLocator::Types type, QgsPointLocator::MatchFilter *filter = nullptr );
7972

8073
// environment setup
8174

0 commit comments

Comments
 (0)
Please sign in to comment.