Skip to content
Permalink
Browse files
Fix anchor point when selected features and when no features near click
  • Loading branch information
uclaros committed Apr 26, 2021
1 parent 583a89c commit 88a78dca98983874e0c20b39b7f676e7c1f5aae2
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/app/qgsmaptoolscalefeature.cpp
@@ -244,6 +244,8 @@ void QgsMapToolScaleFeature::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
if ( minDistance == std::numeric_limits<double>::max() )
{
emit messageEmitted( tr( "Could not find a nearby feature in the current layer." ) );
if ( mAutoSetAnchorPoint )
mAnchorPoint.reset();
return;
}

@@ -409,7 +411,7 @@ void QgsMapToolScaleFeature::activate()
if ( vlayer->selectedFeatureCount() > 0 )
{
mExtent = vlayer->boundingBoxOfSelected();
mFeatureCenterMapCoords = mExtent.center();
mFeatureCenterMapCoords = toMapCoordinates( vlayer, mExtent.center() );

mAnchorPoint = std::make_unique<QgsVertexMarker>( mCanvas );
mAnchorPoint->setIconType( QgsVertexMarker::ICON_CROSS );

0 comments on commit 88a78dc

Please sign in to comment.