diff --git a/eeschema/tools/ee_selection_tool.cpp b/eeschema/tools/ee_selection_tool.cpp index 408216ed38..1ec5ef756d 100644 --- a/eeschema/tools/ee_selection_tool.cpp +++ b/eeschema/tools/ee_selection_tool.cpp @@ -47,6 +47,7 @@ #include #include #include +#include #include #include #include @@ -58,7 +59,6 @@ #include #include - SELECTION_CONDITION EE_CONDITIONS::SingleSymbol = []( const SELECTION& aSel ) { if( aSel.GetSize() == 1 ) @@ -986,15 +986,16 @@ void EE_SELECTION_TOOL::GuessSelectionCandidates( EE_COLLECTOR& collector, const for( int i = collector.GetCount() - 1; i >= 0; --i ) { - EDA_ITEM* item = collector[ i ]; - SCH_LINE* line = dynamic_cast( item ); + EDA_ITEM* item = collector[ i ]; + SCH_LINE* line = dynamic_cast( item ); + LIB_SHAPE* shape = dynamic_cast( item ); // Lines are hard to hit. Give them a bit more slop to still be considered "exact". - if( line ) + if( line || ( shape && shape->GetShape() == SHAPE_T::POLY ) ) { - if( line->HitTest( (wxPoint) aPos, Mils2iu( DANGLING_SYMBOL_SIZE ) ) ) - exactHits.insert( line ); + if( item->HitTest( (wxPoint) aPos, Mils2iu( DANGLING_SYMBOL_SIZE ) ) ) + exactHits.insert( item ); } else { @@ -1016,7 +1017,8 @@ void EE_SELECTION_TOOL::GuessSelectionCandidates( EE_COLLECTOR& collector, const // Find the closest item. (Note that at this point all hits are either exact or non-exact.) wxPoint pos( aPos ); - SEG poss( aPos, aPos ); + SEG poss( m_isSymbolEditor ? mapCoords( pos ) : pos, + m_isSymbolEditor ? mapCoords( pos ) : pos ); EDA_ITEM* closest = nullptr; int closestDist = INT_MAX / 2;