pcbnew: Adjust selection behavior in highlight net

Prefer non-zones in highlight net in the same way we do for the
selection tool.  Highlight net just has separate logic and was missed
previously.
This commit is contained in:
Seth Hillbrand 2018-10-05 19:58:25 -07:00
parent ceca3e526c
commit 502383b759
4 changed files with 13 additions and 7 deletions

View File

@ -100,12 +100,10 @@ const KICAD_T GENERAL_COLLECTOR::PadsOrModules[] = {
}; };
const KICAD_T GENERAL_COLLECTOR::PadsTracksOrZones[] = { const KICAD_T GENERAL_COLLECTOR::PadsOrTracks[] = {
PCB_PAD_T, PCB_PAD_T,
PCB_VIA_T, PCB_VIA_T,
PCB_TRACE_T, PCB_TRACE_T,
PCB_SEGZONE_T,
PCB_ZONE_AREA_T,
EOT EOT
}; };

View File

@ -285,9 +285,9 @@ public:
static const KICAD_T PadsOrModules[]; static const KICAD_T PadsOrModules[];
/** /**
* A scan list for PADs, TRACKs, VIAs, or ZONEs * A scan list for PADs, TRACKs, or VIAs
*/ */
static const KICAD_T PadsTracksOrZones[]; static const KICAD_T PadsOrTracks[];
/** /**
* A scan list for MODULEs and their items (for Modedit) * A scan list for MODULEs and their items (for Modedit)

View File

@ -56,9 +56,13 @@ int PCB_EDIT_FRAME::SelectHighLight( wxDC* DC )
// optionally, modify the "guide" here as needed using its member functions // optionally, modify the "guide" here as needed using its member functions
m_Collector->Collect( GetBoard(), GENERAL_COLLECTOR::PadsTracksOrZones, m_Collector->Collect( GetBoard(), GENERAL_COLLECTOR::PadsOrTracks,
RefPos( true ), guide ); RefPos( true ), guide );
if( m_Collector->GetCount() == 0 )
m_Collector->Collect( GetBoard(), GENERAL_COLLECTOR::Zones,
RefPos( true ), guide );
BOARD_ITEM* item = (*m_Collector)[0]; BOARD_ITEM* item = (*m_Collector)[0];
if( item ) if( item )

View File

@ -951,9 +951,13 @@ static bool highlightNet( TOOL_MANAGER* aToolMgr, const VECTOR2D& aPosition,
GENERAL_COLLECTOR collector; GENERAL_COLLECTOR collector;
// Find a connected item for which we are going to highlight a net // Find a connected item for which we are going to highlight a net
collector.Collect( board, GENERAL_COLLECTOR::PadsTracksOrZones, collector.Collect( board, GENERAL_COLLECTOR::PadsOrTracks,
wxPoint( aPosition.x, aPosition.y ), guide ); wxPoint( aPosition.x, aPosition.y ), guide );
if( collector.GetCount() == 0 )
collector.Collect( board, GENERAL_COLLECTOR::Zones,
wxPoint( aPosition.x, aPosition.y ), guide );
for( int i = 0; i < collector.GetCount(); i++ ) for( int i = 0; i < collector.GetCount(); i++ )
{ {
if( collector[i]->Type() == PCB_PAD_T ) if( collector[i]->Type() == PCB_PAD_T )