File tree Expand file tree Collapse file tree 2 files changed +11
-11
lines changed Expand file tree Collapse file tree 2 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -554,7 +554,17 @@ bool QgsAdvancedDigitizingDockWidget::applyConstraints( QgsMapMouseEvent *e )
554
554
e->setMapPoint ( point );
555
555
556
556
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
+ }
558
568
// update the point list
559
569
updateCurrentPoint ( point );
560
570
Original file line number Diff line number Diff line change @@ -34,11 +34,6 @@ void QgsMapToolAdvancedDigitizing::canvasPressEvent( QgsMapMouseEvent *e )
34
34
{
35
35
mCadDockWidget ->applyConstraints ( e ); // updates event's map point
36
36
37
- if ( mCadDockWidget ->mapPointMatch ().hasVertex () )
38
- {
39
- e->snapPoint ();
40
- }
41
-
42
37
if ( mCadDockWidget ->constructionMode () )
43
38
return ; // decided to eat the event and not pass it to the map tool (construction mode)
44
39
}
@@ -78,11 +73,6 @@ void QgsMapToolAdvancedDigitizing::canvasReleaseEvent( QgsMapMouseEvent *e )
78
73
79
74
mCadDockWidget ->releaseLocks ( false );
80
75
81
- if ( mCadDockWidget ->mapPointMatch ().hasVertex () )
82
- {
83
- e->snapPoint ();
84
- }
85
-
86
76
if ( mCadDockWidget ->constructionMode () )
87
77
return ; // decided to eat the event and not pass it to the map tool (construction mode)
88
78
}
You can’t perform that action at this time.
0 commit comments