From 1bec10b6fa4a41e5a32595b236522264fb665cce Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Thu, 11 Feb 2021 12:13:38 -0500 Subject: [PATCH] Make it easy to select small things overlapping symbols Fixes https://gitlab.com/kicad/code/kicad/-/issues/7487 --- eeschema/tools/ee_selection_tool.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/eeschema/tools/ee_selection_tool.cpp b/eeschema/tools/ee_selection_tool.cpp index 05fdb56e12..6383139d1b 100644 --- a/eeschema/tools/ee_selection_tool.cpp +++ b/eeschema/tools/ee_selection_tool.cpp @@ -932,13 +932,23 @@ void EE_SELECTION_TOOL::GuessSelectionCandidates( EE_COLLECTOR& collector, const } } - // Prefer a field to a symbol + // Prefer things that are generally smaller than a symbol to a symbol + const std::set preferred = + { + SCH_FIELD_T, + SCH_LINE_T, + SCH_BUS_WIRE_ENTRY_T, + SCH_NO_CONNECT_T, + SCH_JUNCTION_T, + SCH_MARKER_T + }; + for( int i = 0; collector.GetCount() == 2 && i < 2; ++i ) { EDA_ITEM* item = collector[ i ]; EDA_ITEM* other = collector[ ( i + 1 ) % 2 ]; - if( item->Type() == SCH_FIELD_T && other->Type() == SCH_COMPONENT_T ) + if( preferred.count( item->Type() ) && other->Type() == SCH_COMPONENT_T ) collector.Transfer( other ); }