Skip to content
Permalink
Browse files

revert adding tolerance to QgsSnappingUtils::snapToCurrentLayer

since it already uses digitizing settings
  • Loading branch information
3nids committed Feb 19, 2018
1 parent 337fa7b commit 965a4e87aa8b7e7ef6133ec9e1424dbed6c5f16f
Showing with 6 additions and 21 deletions.
  1. +2 −9 python/core/qgssnappingutils.sip.in
  2. +2 −3 src/core/qgssnappingutils.cpp
  3. +2 −9 src/core/qgssnappingutils.h
@@ -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


@@ -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 )
@@ -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

0 comments on commit 965a4e8

Please sign in to comment.
You can’t perform that action at this time.