Skip to content

Commit

Permalink
Needs to snap point too when CadDockWidget is enabled. Fixes #18138
Browse files Browse the repository at this point in the history
  • Loading branch information
lbartoletti committed Mar 4, 2019
1 parent 50c9a5e commit a4f1c79
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/gui/qgsadvanceddigitizingdockwidget.cpp
Expand Up @@ -555,6 +555,8 @@ bool QgsAdvancedDigitizingDockWidget::applyConstraints( QgsMapMouseEvent *e )

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

mSnappedToVertex = mSnapMatch.hasVertex();

// update the point list
updateCurrentPoint( point );

Expand Down
10 changes: 10 additions & 0 deletions src/gui/qgsmaptooladvanceddigitizing.cpp
Expand Up @@ -34,6 +34,11 @@ void QgsMapToolAdvancedDigitizing::canvasPressEvent( QgsMapMouseEvent *e )
{
mCadDockWidget->applyConstraints( e ); // updates event's map point

if ( mCadDockWidget->mapPointMatch().hasVertex() )
{
e->snapPoint();
}

if ( mCadDockWidget->constructionMode() )
return; // decided to eat the event and not pass it to the map tool (construction mode)
}
Expand Down Expand Up @@ -73,6 +78,11 @@ void QgsMapToolAdvancedDigitizing::canvasReleaseEvent( QgsMapMouseEvent *e )

mCadDockWidget->releaseLocks( false );

if ( mCadDockWidget->mapPointMatch().hasVertex() )
{
e->snapPoint();
}

if ( mCadDockWidget->constructionMode() )
return; // decided to eat the event and not pass it to the map tool (construction mode)
}
Expand Down

0 comments on commit a4f1c79

Please sign in to comment.