Clear all dirty connectivity flags on symbols
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17984 When moving / deleting a power symbol, in some instances the symbol is marked dirty, and sometimes the pin (depending on whether the symbol is the primary edited item, or whether the pin is identified through an edited item subgraph). If the pin and the symbol are marked dirty, the pin dirty flag was not being cleared. Additionally, not all extracted items were being deleted from subgraphs correctly. Both resulted in dirty state and duplicated items in the subgraphs during incremental connectivity, which resulted in essentially corrupted subgraph states.
This commit is contained in:
parent
093da7f73a
commit
89dff6411b
|
@ -720,6 +720,20 @@ void CONNECTION_GRAPH::Recalculate( const SCH_SHEET_LIST& aSheetList, bool aUnco
|
|||
item->GetTypeDesc() );
|
||||
items.push_back( item );
|
||||
dirty_items.insert( item );
|
||||
|
||||
// Add any symbol dirty pins to the dirty_items list
|
||||
if( item->Type() == SCH_SYMBOL_T )
|
||||
{
|
||||
SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
|
||||
|
||||
for( SCH_PIN* pin : symbol->GetPins( &sheet ) )
|
||||
{
|
||||
if( pin->IsConnectivityDirty() )
|
||||
{
|
||||
dirty_items.insert( pin );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// If the symbol isn't dirty, look at the pins
|
||||
// TODO: remove symbols from connectivity graph and only use pins
|
||||
|
@ -890,6 +904,9 @@ std::set<std::pair<SCH_SHEET_PATH, SCH_ITEM*>> CONNECTION_GRAPH::ExtractAffected
|
|||
|
||||
removeSubgraphs( subgraphs );
|
||||
|
||||
for( const auto& [path, item] : retvals )
|
||||
alg::delete_matching( m_items, item );
|
||||
|
||||
return retvals;
|
||||
}
|
||||
|
||||
|
@ -2988,7 +3005,7 @@ CONNECTION_SUBGRAPH* CONNECTION_GRAPH::FindFirstSubgraphByName( const wxString&
|
|||
}
|
||||
|
||||
|
||||
CONNECTION_SUBGRAPH* CONNECTION_GRAPH::GetSubgraphForItem( SCH_ITEM* aItem )
|
||||
CONNECTION_SUBGRAPH* CONNECTION_GRAPH::GetSubgraphForItem( SCH_ITEM* aItem ) const
|
||||
{
|
||||
auto it = m_item_to_subgraph_map.find( aItem );
|
||||
CONNECTION_SUBGRAPH* ret = it != m_item_to_subgraph_map.end() ? it->second : nullptr;
|
||||
|
|
|
@ -428,7 +428,7 @@ public:
|
|||
*/
|
||||
CONNECTION_SUBGRAPH* FindFirstSubgraphByName( const wxString& aNetName );
|
||||
|
||||
CONNECTION_SUBGRAPH* GetSubgraphForItem( SCH_ITEM* aItem );
|
||||
CONNECTION_SUBGRAPH* GetSubgraphForItem( SCH_ITEM* aItem ) const;
|
||||
|
||||
const std::vector<CONNECTION_SUBGRAPH*> GetAllSubgraphs( const wxString& aNetName ) const;
|
||||
|
||||
|
|
Loading…
Reference in New Issue