Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 859f30f

Browse files
committedMar 12, 2019
apply martin's review
1 parent 3a360ac commit 859f30f

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed
 

‎src/gui/qgsadvanceddigitizingdockwidget.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,17 @@ bool QgsAdvancedDigitizingDockWidget::applyConstraints( QgsMapMouseEvent *e )
554554
e->setMapPoint( point );
555555

556556
mSnapMatch = context.snappingUtils->snapToMap( point );
557-
557+
/*
558+
* Constraints are applied in 2D, they are always called when using the tool
559+
* but they do not take into account if when you snap on a vertex it has
560+
* a Z value.
561+
* To get the value we use the snapPoint method. However, we only apply it
562+
* when the snapped point corresponds to the constrained point.
563+
*/
564+
if ( mSnapMatch.hasVertex() && ( point == mSnapMatch.point() ) )
565+
{
566+
e->snapPoint();
567+
}
558568
// update the point list
559569
updateCurrentPoint( point );
560570

‎src/gui/qgsmaptooladvanceddigitizing.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,6 @@ void QgsMapToolAdvancedDigitizing::canvasPressEvent( QgsMapMouseEvent *e )
3434
{
3535
mCadDockWidget->applyConstraints( e ); // updates event's map point
3636

37-
if ( mCadDockWidget->mapPointMatch().hasVertex() )
38-
{
39-
e->snapPoint();
40-
}
41-
4237
if ( mCadDockWidget->constructionMode() )
4338
return; // decided to eat the event and not pass it to the map tool (construction mode)
4439
}
@@ -78,11 +73,6 @@ void QgsMapToolAdvancedDigitizing::canvasReleaseEvent( QgsMapMouseEvent *e )
7873

7974
mCadDockWidget->releaseLocks( false );
8075

81-
if ( mCadDockWidget->mapPointMatch().hasVertex() )
82-
{
83-
e->snapPoint();
84-
}
85-
8676
if ( mCadDockWidget->constructionMode() )
8777
return; // decided to eat the event and not pass it to the map tool (construction mode)
8878
}

0 commit comments

Comments
 (0)
Please sign in to comment.