revert adding tolerance to QgsSnappingUtils::snapToCurrentLayer

since it already uses digitizing settings
This commit is contained in:
Denis Rouzaud 2018-02-18 13:42:44 -04:00
parent 337fa7b152
commit 965a4e87aa
3 changed files with 6 additions and 21 deletions

View File

@ -54,16 +54,9 @@ Snap to map according to the current configuration. Optional filter allows disca
QgsPointLocator::Match snapToMap( const QgsPointXY &pointMap, QgsPointLocator::MatchFilter *filter = 0 );
QgsPointLocator::Match snapToCurrentLayer( QPoint point, QgsPointLocator::Types type, QgsPointLocator::MatchFilter *filter = 0, double tolerance = 0.0 );
QgsPointLocator::Match snapToCurrentLayer( QPoint point, QgsPointLocator::Types type, QgsPointLocator::MatchFilter *filter = 0 );
%Docstring
snapToCurrentLayer snap to current layer with given settings
:param point: the point to snap from
:param type: the matching type (vertex, edge, area)
:param filter: the matching filter
:param tolerance: the tolerance in project units. If left to 0, it is calculated from current map settings
:return: the snapping match
Snap to current layer
%End

View File

@ -440,14 +440,13 @@ void QgsSnappingUtils::toggleEnabled()
emit configChanged( mSnappingConfig );
}
QgsPointLocator::Match QgsSnappingUtils::snapToCurrentLayer( QPoint point, QgsPointLocator::Types type, QgsPointLocator::MatchFilter *filter, double tolerance )
QgsPointLocator::Match QgsSnappingUtils::snapToCurrentLayer( QPoint point, QgsPointLocator::Types type, QgsPointLocator::MatchFilter *filter )
{
if ( !mCurrentLayer )
return QgsPointLocator::Match();
QgsPointXY pointMap = mMapSettings.mapToPixel().toMapCoordinates( point );
if ( tolerance == 0.0 )
tolerance = QgsTolerance::vertexSearchRadius( mMapSettings );
double tolerance = QgsTolerance::vertexSearchRadius( mMapSettings );
QgsPointLocator *loc = locatorForLayerUsingStrategy( mCurrentLayer, pointMap, tolerance );
if ( !loc )

View File

@ -67,15 +67,8 @@ class CORE_EXPORT QgsSnappingUtils : public QObject
//! Snap to current layer
/**
* \brief snapToCurrentLayer snap to current layer with given settings
* \param point the point to snap from
* \param type the matching type (vertex, edge, area)
* \param filter the matching filter
* \param tolerance the tolerance in project units. If left to 0, it is calculated from current map settings
* \return the snapping match
*/
QgsPointLocator::Match snapToCurrentLayer( QPoint point, QgsPointLocator::Types type, QgsPointLocator::MatchFilter *filter = nullptr, double tolerance = 0.0 );
//! Snap to current layer
QgsPointLocator::Match snapToCurrentLayer( QPoint point, QgsPointLocator::Types type, QgsPointLocator::MatchFilter *filter = nullptr );
// environment setup