File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -34,18 +34,21 @@ QgsMapToolAdvancedDigitizing::~QgsMapToolAdvancedDigitizing()
34
34
35
35
void QgsMapToolAdvancedDigitizing::canvasPressEvent ( QgsMapMouseEvent* e )
36
36
{
37
+ snap ( e );
37
38
if ( !mCadDockWidget ->canvasPressEvent ( e ) )
38
39
cadCanvasPressEvent ( e );
39
40
}
40
41
41
42
void QgsMapToolAdvancedDigitizing::canvasReleaseEvent ( QgsMapMouseEvent* e )
42
43
{
44
+ snap ( e );
43
45
if ( !mCadDockWidget ->canvasReleaseEvent ( e, mCaptureMode == CaptureLine || mCaptureMode == CapturePolygon ) )
44
46
cadCanvasReleaseEvent ( e );
45
47
}
46
48
47
49
void QgsMapToolAdvancedDigitizing::canvasMoveEvent ( QgsMapMouseEvent* e )
48
50
{
51
+ snap ( e );
49
52
if ( !mCadDockWidget ->canvasMoveEvent ( e ) )
50
53
cadCanvasMoveEvent ( e );
51
54
}
@@ -70,3 +73,9 @@ void QgsMapToolAdvancedDigitizing::cadPointChanged( const QgsPoint& point )
70
73
fakeEvent.setMapPoint ( point );
71
74
canvasMoveEvent ( &fakeEvent );
72
75
}
76
+
77
+ void QgsMapToolAdvancedDigitizing::snap ( QgsMapMouseEvent* e )
78
+ {
79
+ if ( !mCadDockWidget ->cadEnabled () )
80
+ e->snapPoint ( QgsMapMouseEvent::SnapProjectConfig );
81
+ }
Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ class GUI_EXPORT QgsMapToolAdvancedDigitizing : public QgsMapToolEdit
123
123
private slots:
124
124
/* *
125
125
* Is to be called by the cad system whenever a point changes outside of a
126
- * mouse event. E.g. when additional constraints are triggered .
126
+ * mouse event. E.g. when additional constraints are toggled .
127
127
* The specified point will be used to generate a fake mouse event which will
128
128
* be sent as move event to cadCanvasMoveEvent.
129
129
*
@@ -133,6 +133,8 @@ class GUI_EXPORT QgsMapToolAdvancedDigitizing : public QgsMapToolEdit
133
133
134
134
private:
135
135
QgsAdvancedDigitizingDockWidget* mCadDockWidget ;
136
+
137
+ void snap ( QgsMapMouseEvent* e );
136
138
};
137
139
138
140
#endif // QGSMAPTOOLADVANCEDDIGITIZE_H
You can’t perform that action at this time.
0 commit comments