Browse Source

Don't assume all EDA_ITEMs are BOARD_ITEMs (KICAD-KCZ).

pull/18/head
Jeff Young 5 months ago
parent
commit
b7362c3fb5
  1. 9
      pcbnew/tools/pcb_selection_tool.cpp

9
pcbnew/tools/pcb_selection_tool.cpp

@ -1438,17 +1438,23 @@ int PCB_SELECTION_TOOL::unrouteSegment( const TOOL_EVENT& aEvent )
// This will select the unroute items too, so filter them out // This will select the unroute items too, so filter them out
for( EDA_ITEM* item : m_selection.GetItemsSortedByTypeAndXY() ) for( EDA_ITEM* item : m_selection.GetItemsSortedByTypeAndXY() )
{ {
if( !item->IsBOARD_ITEM() )
continue;
if( std::find( toUnroute.begin(), toUnroute.end(), item ) == toUnroute.end() ) if( std::find( toUnroute.begin(), toUnroute.end(), item ) == toUnroute.end() )
toSelectAfter.push_back( item ); toSelectAfter.push_back( item );
} }
ClearSelection( true ); ClearSelection( true );
for( EDA_ITEM* item : toUnroute ) for( EDA_ITEM* item : toUnroute )
select( item ); select( item );
m_toolMgr->RunAction( ACTIONS::doDelete ); m_toolMgr->RunAction( ACTIONS::doDelete );
// Now our after tracks so the user can continue backing up as desired // Now our after tracks so the user can continue backing up as desired
ClearSelection( true ); ClearSelection( true );
for( EDA_ITEM* item : toSelectAfter ) for( EDA_ITEM* item : toSelectAfter )
select( item ); select( item );
@ -3268,6 +3274,9 @@ bool PCB_SELECTION_TOOL::selectionContains( const VECTOR2I& aPoint ) const
// Check if the point is located close to any of the currently selected items // Check if the point is located close to any of the currently selected items
for( EDA_ITEM* item : m_selection ) for( EDA_ITEM* item : m_selection )
{ {
if( !item->IsBOARD_ITEM() )
continue;
BOX2I itemBox = item->ViewBBox(); BOX2I itemBox = item->ViewBBox();
itemBox.Inflate( margin ); // Give some margin for gripping an item itemBox.Inflate( margin ); // Give some margin for gripping an item

Loading…
Cancel
Save