Navigation Menu

Skip to content

Commit

Permalink
Fix anchor point when selected features and when no features near click
Browse files Browse the repository at this point in the history
  • Loading branch information
uclaros committed Apr 26, 2021
1 parent 583a89c commit 88a78dc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/app/qgsmaptoolscalefeature.cpp
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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 );
Expand Down

0 comments on commit 88a78dc

Please sign in to comment.