Give selection preference to pins over wires.

Fixes https://gitlab.com/kicad/code/kicad/issues/9063
This commit is contained in:
Jeff Young 2021-09-23 23:58:46 +01:00
parent 9ea6b44ee8
commit 42687f5d9d
1 changed files with 9 additions and 6 deletions

View File

@ -1023,13 +1023,16 @@ void EE_SELECTION_TOOL::GuessSelectionCandidates( EE_COLLECTOR& collector, const
if( exactHits.count( item ) )
{
if( item->Type() == SCH_PIN_T || item->Type() == SCH_JUNCTION_T )
{
closest = item;
break;
}
wxPoint pos( aPos );
SCH_LINE* line = dynamic_cast<SCH_LINE*>( item );
SCH_JUNCTION* junction = dynamic_cast<SCH_JUNCTION*>( item );
if( junction )
dist = 0; // Hits *inside* a junction dot should select the dot
else if( line )
if( line )
dist = DistanceLinePoint( line->GetStartPoint(), line->GetEndPoint(), pos );
else
dist = EuclideanNorm( bbox.GetCenter() - pos ) * 2;