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()
3434
3535void QgsMapToolAdvancedDigitizing::canvasPressEvent ( QgsMapMouseEvent* e )
3636{
37+ snap ( e );
3738 if ( !mCadDockWidget ->canvasPressEvent ( e ) )
3839 cadCanvasPressEvent ( e );
3940}
4041
4142void QgsMapToolAdvancedDigitizing::canvasReleaseEvent ( QgsMapMouseEvent* e )
4243{
44+ snap ( e );
4345 if ( !mCadDockWidget ->canvasReleaseEvent ( e, mCaptureMode == CaptureLine || mCaptureMode == CapturePolygon ) )
4446 cadCanvasReleaseEvent ( e );
4547}
4648
4749void QgsMapToolAdvancedDigitizing::canvasMoveEvent ( QgsMapMouseEvent* e )
4850{
51+ snap ( e );
4952 if ( !mCadDockWidget ->canvasMoveEvent ( e ) )
5053 cadCanvasMoveEvent ( e );
5154}
@@ -70,3 +73,9 @@ void QgsMapToolAdvancedDigitizing::cadPointChanged( const QgsPoint& point )
7073 fakeEvent.setMapPoint ( point );
7174 canvasMoveEvent ( &fakeEvent );
7275}
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
123123 private slots:
124124 /* *
125125 * 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 .
127127 * The specified point will be used to generate a fake mouse event which will
128128 * be sent as move event to cadCanvasMoveEvent.
129129 *
@@ -133,6 +133,8 @@ class GUI_EXPORT QgsMapToolAdvancedDigitizing : public QgsMapToolEdit
133133
134134 private:
135135 QgsAdvancedDigitizingDockWidget* mCadDockWidget ;
136+
137+ void snap ( QgsMapMouseEvent* e );
136138};
137139
138140#endif // QGSMAPTOOLADVANCEDDIGITIZE_H
You can’t perform that action at this time.
0 commit comments