Skip to content
Permalink
Browse files

apply martin's review

  • Loading branch information
lbartoletti authored and nyalldawson committed Mar 13, 2019
1 parent 4bc7c5b commit 239f1dc94f52fe68ee87d20c8ea4c004edb05315
Showing with 11 additions and 11 deletions.
  1. +11 −1 src/gui/qgsadvanceddigitizingdockwidget.cpp
  2. +0 −10 src/gui/qgsmaptooladvanceddigitizing.cpp
@@ -554,7 +554,17 @@ bool QgsAdvancedDigitizingDockWidget::applyConstraints( QgsMapMouseEvent *e )
e->setMapPoint( point );

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

/*
* Constraints are applied in 2D, they are always called when using the tool
* but they do not take into account if when you snap on a vertex it has
* a Z value.
* To get the value we use the snapPoint method. However, we only apply it
* when the snapped point corresponds to the constrained point.
*/
if ( mSnapMatch.hasVertex() && ( point == mSnapMatch.point() ) )
{
e->snapPoint();
}
// update the point list
updateCurrentPoint( point );

@@ -34,11 +34,6 @@ 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)
}
@@ -78,11 +73,6 @@ 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 239f1dc

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