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:
timlinux 2008-10-10 21:36:34 +00:00
parent 1080d9de32
commit 926ebeeab9
2 changed files with 19 additions and 1 deletions

View File

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

View File

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