mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-15 00:04:00 -04:00
revert adding tolerance to QgsSnappingUtils::snapToCurrentLayer
since it already uses digitizing settings
This commit is contained in:
parent
337fa7b152
commit
965a4e87aa
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user