Skip to content

Commit 6fbe8cf

Browse files
lbartolettinyalldawson
authored andcommitted
Needs to snap point too when CadDockWidget is enabled. Fixes #18138
1 parent a17e394 commit 6fbe8cf

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/gui/qgsadvanceddigitizingdockwidget.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,8 @@ bool QgsAdvancedDigitizingDockWidget::applyConstraints( QgsMapMouseEvent *e )
555555

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

558+
mSnappedToVertex = mSnapMatch.hasVertex();
559+
558560
// update the point list
559561
updateCurrentPoint( point );
560562

src/gui/qgsmaptooladvanceddigitizing.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ 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+
3742
if ( mCadDockWidget->constructionMode() )
3843
return; // decided to eat the event and not pass it to the map tool (construction mode)
3944
}
@@ -73,6 +78,11 @@ void QgsMapToolAdvancedDigitizing::canvasReleaseEvent( QgsMapMouseEvent *e )
7378

7479
mCadDockWidget->releaseLocks( false );
7580

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

0 commit comments

Comments
 (0)