Skip to content

Commit

Permalink
use defaultMValue in QgsMapToolCapture
Browse files Browse the repository at this point in the history
  • Loading branch information
lbartoletti committed Apr 30, 2021
1 parent d8e91ac commit 0b381b9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/gui/qgsmaptoolcapture.cpp
Expand Up @@ -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 )
{
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 0b381b9

Please sign in to comment.