Ensure component bounding boxes are correct

This was causing junctions to not always be added on wire
segments that overlapped component pins, because the pin
might not be part of the component bounding box before
UpdateLocalLibSymbolLinks() is called.  When the bbox
was never updated, these symbols weren't collected by
the rtree query for objects overlapping a point.
This commit is contained in:
Jon Evans 2020-05-20 18:50:09 -04:00
parent a49fde5ce0
commit b6d7bc36d0
1 changed files with 9 additions and 1 deletions

View File

@ -746,9 +746,15 @@ void SCH_SCREEN::UpdateSymbolLinks( REPORTER* aReporter )
void SCH_SCREEN::UpdateLocalLibSymbolLinks()
{
std::vector<SCH_COMPONENT*> symbols;
for( auto item : Items().OfType( SCH_COMPONENT_T ) )
symbols.push_back( static_cast<SCH_COMPONENT*>( item ) );
for( auto symbol : symbols )
{
SCH_COMPONENT* symbol = static_cast<SCH_COMPONENT*>( item );
// Changing the symbol may adjust the bbox of the symbol; remove and reinsert it afterwards.
m_rtree.remove( symbol );
auto it = m_libSymbols.find( symbol->GetSchSymbolLibraryName() );
@ -758,6 +764,8 @@ void SCH_SCREEN::UpdateLocalLibSymbolLinks()
libSymbol = new LIB_PART( *it->second );
symbol->SetLibSymbol( libSymbol );
m_rtree.insert( symbol );
}
}