Skip to content

Commit

Permalink
Disable Z interpolation in some cases fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Koyaani authored and nyalldawson committed Jun 18, 2022
1 parent 50f6501 commit 6eeeb69
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/gui/qgsadvanceddigitizingdockwidget.cpp
Expand Up @@ -912,14 +912,19 @@ bool QgsAdvancedDigitizingDockWidget::applyConstraints( QgsMapMouseEvent *e )
* a Z value.
* To get the value we use the snapPoint method. However, we only apply it
* when the snapped point corresponds to the constrained point or on an edge
* if the topological editing is activated.
* if the topological editing is activated. Also, we don't apply it if
* the point is not linked to a layer.
*/
e->setMapPoint( point );
mSnapMatch = context.snappingUtils->snapToMap( point, nullptr, true );
if ( ( ( mSnapMatch.hasVertex() || mSnapMatch.hasLineEndpoint() ) && ( point == mSnapMatch.point() ) ) || ( mSnapMatch.hasEdge() && QgsProject::instance()->topologicalEditing() ) )
if ( mSnapMatch.layer() )
{
e->snapPoint();
point = mSnapMatch.interpolatedPoint( mMapCanvas->mapSettings().destinationCrs() );
if ( ( ( mSnapMatch.hasVertex() || mSnapMatch.hasLineEndpoint() ) && ( point == mSnapMatch.point() ) )
|| ( mSnapMatch.hasEdge() && QgsProject::instance()->topologicalEditing() ) )
{
e->snapPoint();
point = mSnapMatch.interpolatedPoint( mMapCanvas->mapSettings().destinationCrs() );
}
}

/*
Expand Down

0 comments on commit 6eeeb69

Please sign in to comment.