Skip to content
Permalink
Browse files

Needs to snap point too when CadDockWidget is enabled. Fixes #18138

  • Loading branch information
lbartoletti authored and wonder-sk committed Mar 12, 2019
1 parent 857fe53 commit 2a2b7a6532d12c45374c591990b4ba039c201baf
Showing with 12 additions and 0 deletions.
  1. +2 −0 src/gui/qgsadvanceddigitizingdockwidget.cpp
  2. +10 −0 src/gui/qgsmaptooladvanceddigitizing.cpp
@@ -555,6 +555,8 @@ bool QgsAdvancedDigitizingDockWidget::applyConstraints( QgsMapMouseEvent *e )

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

mSnappedToVertex = mSnapMatch.hasVertex();

// update the point list
updateCurrentPoint( point );

@@ -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)
}
@@ -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)
}

0 comments on commit 2a2b7a6

Please sign in to comment.
You can’t perform that action at this time.