Disable Z interpolation in some cases fix #46128

This commit is contained in:
Antoine 2021-12-06 15:36:31 +01:00
parent c3df08492d
commit 2cf8189f89

View File

@ -914,14 +914,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() );
}
}
/*