mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-06 00:07:29 -04:00
More topological editing fixes from Marco
git-svn-id: http://svn.osgeo.org/qgis/trunk@9473 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
1080d9de32
commit
926ebeeab9
@ -91,6 +91,14 @@ void QgsMapToolAddVertex::canvasReleaseEvent( QMouseEvent * e )
|
||||
|
||||
if ( mSnapper.snapToBackgroundLayers( e->pos(), snapResults ) == 0 )
|
||||
{
|
||||
|
||||
//add segment points in case of topological editing
|
||||
int topologicalEditing = QgsProject::instance()->readNumEntry( "Digitizing", "/TopologicalEditing", 0 );
|
||||
if ( topologicalEditing )
|
||||
{
|
||||
insertSegmentVerticesForSnap( snapResults, vlayer );
|
||||
}
|
||||
|
||||
snappedPointMapCoord = snapPointFromResults( snapResults, e->pos() );
|
||||
snappedPointLayerCoord = toLayerCoordinates( vlayer, snappedPointMapCoord );
|
||||
|
||||
|
@ -1906,7 +1906,17 @@ int QgsVectorLayer::addTopologicalPoints( const QgsPoint& p )
|
||||
|
||||
QList<QgsSnappingResult> filteredSnapResults; //we filter out the results that are on existing vertices
|
||||
|
||||
const double threshold = 0.00000001;
|
||||
//work with a tolerance because coordinate projection may introduce some rounding
|
||||
double threshold = 0.0000001;
|
||||
if(mCRS && mCRS->mapUnits() == QGis::Meters)
|
||||
{
|
||||
threshold = 0.001;
|
||||
}
|
||||
else if(mCRS && mCRS->mapUnits() == QGis::Feet)
|
||||
{
|
||||
threshold = 0.0001;
|
||||
}
|
||||
|
||||
|
||||
if ( snapWithContext( p, threshold, snapResults, QgsSnapper::SNAP_TO_SEGMENT ) != 0 )
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user