Skip to content
Permalink
Browse files
Fix node tool sometimes behaving incorrectly with topo editing
This would happen especially when zoomed out due to mismatch of snapping match vs original map point
  • Loading branch information
wonder-sk committed Sep 11, 2017
1 parent 7c9105d commit 494fa15
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
@@ -1030,11 +1030,11 @@ void QgsNodeTool::startDragging( QgsMapMouseEvent *e )
}
else // vertex
{
startDraggingMoveVertex( e->mapPoint(), m );
startDraggingMoveVertex( m );
}
}

void QgsNodeTool::startDraggingMoveVertex( const QgsPointXY &mapPoint, const QgsPointLocator::Match &m )
void QgsNodeTool::startDraggingMoveVertex( const QgsPointLocator::Match &m )
{
Q_ASSERT( m.hasVertex() );

@@ -1079,7 +1079,7 @@ void QgsNodeTool::startDraggingMoveVertex( const QgsPointXY &mapPoint, const Qgs
if ( !vlayer || !vlayer->isEditable() )
continue;

for ( const QgsPointLocator::Match &otherMatch : layerVerticesSnappedToPoint( vlayer, mapPoint ) )
for ( const QgsPointLocator::Match &otherMatch : layerVerticesSnappedToPoint( vlayer, m.point() ) )
{
if ( otherMatch.layer() == m.layer() &&
otherMatch.featureId() == m.featureId() &&
@@ -133,7 +133,7 @@ class APP_EXPORT QgsNodeTool : public QgsMapToolAdvancedDigitizing

void startDragging( QgsMapMouseEvent *e );

void startDraggingMoveVertex( const QgsPointXY &mapPoint, const QgsPointLocator::Match &m );
void startDraggingMoveVertex( const QgsPointLocator::Match &m );

//! Get list of matches of all vertices of a layer exactly snapped to a map point
QList<QgsPointLocator::Match> layerVerticesSnappedToPoint( QgsVectorLayer *layer, const QgsPointXY &mapPoint );

0 comments on commit 494fa15

Please sign in to comment.