Ensure that missing pins are added to extraction

When changing from a larger part to a smaller part, the previously
existing pins may be removed from the screen but still linked to
elements in the connection graph because we don't set them dirty unless
the changed element overlaps

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17851

(cherry picked from commit 0cd3e17db7)
This commit is contained in:
Seth Hillbrand 2024-04-23 19:35:29 -07:00
parent 3517d25aec
commit 3a29fa44e3
1 changed files with 20 additions and 0 deletions

View File

@ -1736,6 +1736,26 @@ void SCH_EDIT_FRAME::RecalculateConnections( SCH_COMMIT* aCommit, SCH_CLEANUP_FL
pts.insert( pts.end(), tmp_pts.begin(), tmp_pts.end() );
changed_items.insert( item );
for( SCH_SHEET_PATH& path : paths )
item_paths.insert( std::make_pair( path, item ) );
item = dynamic_cast<SCH_ITEM*>( changed_list->GetPickedItemLink( ii ) );
if( !item || !item->IsConnectable() )
continue;
tmp_pts = item->GetConnectionPoints();
pts.insert( pts.end(), tmp_pts.begin(), tmp_pts.end() );
changed_items.insert( item );
// We have to directly add the pins here because the link may not exist on the schematic
// anymore and so won't be picked up by GetScreen()->Items().Overlapping() below.
if( SCH_SYMBOL* symbol = dynamic_cast<SCH_SYMBOL*>( item ) )
{
std::vector<SCH_PIN*> pins = symbol->GetPins();
changed_items.insert( pins.begin(), pins.end() );
}
for( SCH_SHEET_PATH& path : paths )
item_paths.insert( std::make_pair( path, item ) );
}