Node tool: add default Z value to new vertices in 3D geometries (fixes #16240)

This commit is contained in:
Martin Dobias 2017-06-08 21:53:56 +02:00
parent bdd81685a1
commit f5b38fedba

View File

@ -1390,7 +1390,11 @@ void QgsNodeTool::moveVertex( const QgsPointXY &mapPoint, const QgsPointLocator:
if ( addingAtEndpoint && vid.vertex != 0 ) // appending?
vid.vertex++;
if ( !geomTmp->insertVertex( vid, QgsPoint( layerPoint ) ) )
QgsPoint pt( layerPoint );
if ( QgsWkbTypes::hasZ( dragLayer->wkbType() ) )
pt.addZValue( defaultZValue() );
if ( !geomTmp->insertVertex( vid, pt ) )
{
QgsDebugMsg( "append vertex failed!" );
return;