From 2162b53d72de34fcfc28ed211f0991c2433ae34f Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Sun, 7 Apr 2019 21:57:45 -0400 Subject: [PATCH] Allow selecting more items for highlighting --- eeschema/sch_screen.cpp | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/eeschema/sch_screen.cpp b/eeschema/sch_screen.cpp index e3fe6c1eba..fbe5934bc5 100644 --- a/eeschema/sch_screen.cpp +++ b/eeschema/sch_screen.cpp @@ -961,16 +961,31 @@ int SCH_SCREEN::GetNode( const wxPoint& aPosition, EDA_ITEMS& aList ) { for( SCH_ITEM* item = m_drawList.begin(); item; item = item->Next() ) { - if( ( item->Type() == SCH_LINE_T || item->Type() == SCH_BUS_WIRE_ENTRY_T || - item->Type() == SCH_BUS_BUS_ENTRY_T ) - && item->HitTest( aPosition ) - && (item->GetLayer() == LAYER_BUS || item->GetLayer() == LAYER_WIRE) ) + switch( item->Type() ) { - aList.push_back( item ); + case SCH_LINE_T: + case SCH_BUS_WIRE_ENTRY_T: + case SCH_BUS_BUS_ENTRY_T: + { + if( item->HitTest( aPosition ) && + ( item->GetLayer() == LAYER_BUS || item->GetLayer() == LAYER_WIRE ) ) + aList.push_back( item ); + break; } - else if( item->Type() == SCH_JUNCTION_T && item->HitTest( aPosition ) ) + + case SCH_LABEL_T: + case SCH_HIERARCHICAL_LABEL_T: + case SCH_GLOBAL_LABEL_T: + case SCH_SHEET_PIN_T: + case SCH_JUNCTION_T: { - aList.push_back( item ); + if( item->HitTest( aPosition ) ) + aList.push_back( item ); + break; + } + + default: + break; } }