Handle alternate pin definitions when printing.

Fixes https://gitlab.com/kicad/code/kicad/issues/14122

(cherry picked from commit 2973d292d9)
This commit is contained in:
Jeff Young 2023-03-03 10:56:58 +00:00
parent f5b0e20f78
commit e487ca8bd8
1 changed files with 20 additions and 2 deletions

View File

@ -466,7 +466,25 @@ void SCH_SYMBOL::Print( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffse
if( m_part )
{
m_part->Print( aSettings, m_pos + aOffset, m_unit, m_convert, opts, GetDNP() );
LIB_PINS libPins;
m_part->GetPins( libPins, m_unit, m_convert );
LIB_SYMBOL tempSymbol( *m_part );
LIB_PINS tempPins;
tempSymbol.GetPins( tempPins, m_unit, m_convert );
// Copy the pin info from the symbol to the temp pins
for( unsigned i = 0; i < tempPins.size(); ++ i )
{
SCH_PIN* symbolPin = GetPin( libPins[ i ] );
LIB_PIN* tempPin = tempPins[ i ];
tempPin->SetName( symbolPin->GetShownName() );
tempPin->SetType( symbolPin->GetType() );
tempPin->SetShape( symbolPin->GetShape() );
}
tempSymbol.Print( aSettings, m_pos + aOffset, m_unit, m_convert, opts, GetDNP() );
}
else // Use dummy() part if the actual cannot be found.
{
@ -2130,7 +2148,7 @@ void SCH_SYMBOL::Plot( PLOTTER* aPlotter, bool aBackground ) const
tempSymbol.Plot( aPlotter, GetUnit(), GetConvert(), local_background, m_pos, temp,
GetDNP() );
for( SCH_FIELD field : m_fields )
for( const SCH_FIELD& field : m_fields )
field.Plot( aPlotter, local_background );
}