Skip to content

Commit

Permalink
Fix node tool sometimes behaving incorrectly with topo editing
Browse files Browse the repository at this point in the history
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.
6 changes: 3 additions & 3 deletions src/app/nodetool/qgsnodetool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() );

Expand Down Expand Up @@ -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() &&
Expand Down
2 changes: 1 addition & 1 deletion src/app/nodetool/qgsnodetool.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down

0 comments on commit 494fa15

Please sign in to comment.