Skip to content

Commit

Permalink
[composer] When searching snap targets, pick the closest one
Browse files Browse the repository at this point in the history
  • Loading branch information
manisandro authored and nyalldawson committed May 29, 2014
1 parent c38d3e1 commit b751722
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/composer/qgscomposermousehandles.cpp
Expand Up @@ -1300,7 +1300,7 @@ void QgsComposerMouseHandles::checkNearestItem( double checkCoord, const QMap< d
}

double currentDiff = abs( checkCoord - currentCoord );
if ( currentDiff < mComposition->alignmentSnapTolerance() )
if ( currentDiff < mComposition->alignmentSnapTolerance() && currentDiff < smallestDiff )
{
itemCoord = currentCoord + itemCoordOffset;
alignCoord = currentCoord;
Expand Down Expand Up @@ -1348,3 +1348,4 @@ bool QgsComposerMouseHandles::nearestItem( const QMap< double, const QgsComposer
}
}
}

0 comments on commit b751722

Please sign in to comment.