Tune selection of wire endpoints near other objects

Fixes https://gitlab.com/kicad/code/kicad/-/issues/8941
This commit is contained in:
Jon Evans 2021-08-12 22:04:24 -04:00
parent 7075aece3a
commit 766b67a8f1
1 changed files with 5 additions and 1 deletions

View File

@ -1084,7 +1084,11 @@ void EE_SELECTION_TOOL::GuessSelectionCandidates( EE_COLLECTOR& collector, const
for( EDA_ITEM* item : collector )
{
int dist = EuclideanNorm( item->GetBoundingBox().GetCenter() - (wxPoint) aPos );
int dist = EuclideanNorm( item->GetBoundingBox().GetCenter() - wxPoint( aPos ) );
// For wires, if we hit one of the endpoints, consider that perfect
if( item->Type() == SCH_LINE_T && ( item->GetFlags() & ( STARTPOINT | ENDPOINT ) ) )
dist = 0;
if( dist < closestDist )
{