Skip to content
Permalink
Browse files
use defaultMValue in QgsMapToolCapture
  • Loading branch information
lbartoletti committed Apr 30, 2021
1 parent d8e91ac commit 0b381b9fe3bbcbdd51b6aacd64839e276a0bef81
Showing with 7 additions and 2 deletions.
  1. +7 −2 src/gui/qgsmaptoolcapture.cpp
@@ -464,7 +464,7 @@ int QgsMapToolCapture::nextPoint( const QgsPoint &mapPoint, QgsPoint &layerPoint
if ( QgsWkbTypes::hasZ( vlayer->wkbType() ) )
layerPoint.addZValue( defaultZValue() );
if ( QgsWkbTypes::hasM( vlayer->wkbType() ) )
layerPoint.addMValue( 0.0 );
layerPoint.addMValue( defaultMValue() );
}
catch ( QgsCsException &cse )
{
@@ -515,7 +515,7 @@ int QgsMapToolCapture::fetchLayerPoint( const QgsPointLocator::Match &match, Qgs
if ( QgsWkbTypes::hasZ( vlayer->wkbType() ) && !layerPoint.is3D() )
layerPoint.addZValue( defaultZValue() );
if ( QgsWkbTypes::hasM( vlayer->wkbType() ) && !layerPoint.isMeasure() )
layerPoint.addMValue( 0.0 );
layerPoint.addMValue( defaultMValue() );
}

// ZM support depends on the target layer
@@ -1007,6 +1007,11 @@ QgsPoint QgsMapToolCapture::mapPoint( const QgsPointXY &point ) const
{
newPoint.setZ( defaultZValue() );
}
// set m value if necessary
if ( QgsWkbTypes::hasM( newPoint.wkbType() ) )
{
newPoint.setM( defaultMValue() );
}

return newPoint;
}

0 comments on commit 0b381b9

Please sign in to comment.