diff --git a/eeschema/connection_graph.cpp b/eeschema/connection_graph.cpp index 59d467f0ce..ee8656bafb 100644 --- a/eeschema/connection_graph.cpp +++ b/eeschema/connection_graph.cpp @@ -754,6 +754,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( 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 @@ -937,6 +951,9 @@ std::set> CONNECTION_GRAPH::ExtractAffected removeSubgraphs( subgraphs ); + for( const auto& [path, item] : retvals ) + alg::delete_matching( m_items, item ); + return retvals; } @@ -3047,7 +3064,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; diff --git a/eeschema/connection_graph.h b/eeschema/connection_graph.h index 432decce99..bc25b95e44 100644 --- a/eeschema/connection_graph.h +++ b/eeschema/connection_graph.h @@ -434,7 +434,7 @@ public: */ CONNECTION_SUBGRAPH* FindFirstSubgraphByName( const wxString& aNetName ); - CONNECTION_SUBGRAPH* GetSubgraphForItem( SCH_ITEM* aItem ); + CONNECTION_SUBGRAPH* GetSubgraphForItem( SCH_ITEM* aItem ) const; const std::vector GetAllSubgraphs( const wxString& aNetName ) const;