Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
Showing
with
4 additions
and
4 deletions.
-
+3
−3
src/app/nodetool/qgsnodetool.cpp
-
+1
−1
src/app/nodetool/qgsnodetool.h
|
@@ -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 ); |
|
|