Skip to content

Commit

Permalink
show snap indicators for snaps with constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
olivierdalang committed May 21, 2020
1 parent 2942312 commit 66bfde6
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/gui/qgsadvanceddigitizingdockwidget.cpp
Expand Up @@ -667,14 +667,9 @@ bool QgsAdvancedDigitizingDockWidget::applyConstraints( QgsMapMouseEvent *e )
}
}

// set the point coordinates in the map event
e->setMapPoint( point );

mSnapMatch = context.snappingUtils->snapToMap( point, nullptr, true );

if ( mSnapMatch.isValid() )
if ( output.snapMatch.isValid() )
{
mSnapIndicator->setMatch( mSnapMatch );
mSnapIndicator->setMatch( output.snapMatch );
mSnapIndicator->setVisible( true );
}
else
Expand All @@ -690,6 +685,8 @@ bool QgsAdvancedDigitizingDockWidget::applyConstraints( QgsMapMouseEvent *e )
* when the snapped point corresponds to the constrained point or on an edge
* if the topological editing is activated.
*/
e->setMapPoint( point );
mSnapMatch = context.snappingUtils->snapToMap( point, nullptr, true );
if ( ( mSnapMatch.hasVertex() && ( point == mSnapMatch.point() ) ) || ( mSnapMatch.hasEdge() && QgsProject::instance()->topologicalEditing() ) )
{
e->snapPoint();
Expand Down

0 comments on commit 66bfde6

Please sign in to comment.