Skip to content

Commit b751722

Browse files
manisandronyalldawson
authored andcommitted
[composer] When searching snap targets, pick the closest one
1 parent c38d3e1 commit b751722

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/core/composer/qgscomposermousehandles.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1300,7 +1300,7 @@ void QgsComposerMouseHandles::checkNearestItem( double checkCoord, const QMap< d
13001300
}
13011301

13021302
double currentDiff = abs( checkCoord - currentCoord );
1303-
if ( currentDiff < mComposition->alignmentSnapTolerance() )
1303+
if ( currentDiff < mComposition->alignmentSnapTolerance() && currentDiff < smallestDiff )
13041304
{
13051305
itemCoord = currentCoord + itemCoordOffset;
13061306
alignCoord = currentCoord;
@@ -1348,3 +1348,4 @@ bool QgsComposerMouseHandles::nearestItem( const QMap< double, const QgsComposer
13481348
}
13491349
}
13501350
}
1351+

0 commit comments

Comments
 (0)