File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change 25
25
#include " qgswkbtypes.h"
26
26
#include " qgsvectorlayerutils.h"
27
27
#include " qgsvectorlayer.h"
28
+ #include " qgsgeometryoptions.h"
28
29
29
30
#include < limits>
30
31
@@ -614,14 +615,20 @@ int QgsVectorLayerEditUtils::addTopologicalPoints( const QgsPointXY &p )
614
615
double segmentSearchEpsilon = mLayer ->crs ().isGeographic () ? 1e-12 : 1e-8 ;
615
616
616
617
// work with a tolerance because coordinate projection may introduce some rounding
617
- double threshold = 0.0000001 ;
618
- if ( mLayer ->crs ().mapUnits () == QgsUnitTypes::DistanceMeters )
619
- {
620
- threshold = 0.001 ;
621
- }
622
- else if ( mLayer ->crs ().mapUnits () == QgsUnitTypes::DistanceFeet )
618
+ double threshold = mLayer ->geometryOptions ()->geometryPrecision ();
619
+
620
+ if ( qgsDoubleNear ( threshold, 0.0 ) )
623
621
{
624
- threshold = 0.0001 ;
622
+ threshold = 0.0000001 ;
623
+
624
+ if ( mLayer ->crs ().mapUnits () == QgsUnitTypes::DistanceMeters )
625
+ {
626
+ threshold = 0.001 ;
627
+ }
628
+ else if ( mLayer ->crs ().mapUnits () == QgsUnitTypes::DistanceFeet )
629
+ {
630
+ threshold = 0.0001 ;
631
+ }
625
632
}
626
633
627
634
QgsRectangle searchRect ( p.x () - threshold, p.y () - threshold,
You can’t perform that action at this time.
0 commit comments