diff --git a/eeschema/sch_symbol.cpp b/eeschema/sch_symbol.cpp index b0f76dcd35..3508637ef2 100644 --- a/eeschema/sch_symbol.cpp +++ b/eeschema/sch_symbol.cpp @@ -886,7 +886,7 @@ void SCH_SYMBOL::GetLibPins( std::vector& aPinsList ) const } -SCH_PIN* SCH_SYMBOL::GetPin( LIB_PIN* aLibPin ) +SCH_PIN* SCH_SYMBOL::GetPin( LIB_PIN* aLibPin ) const { wxASSERT( m_pinMap.count( aLibPin ) ); return m_pins[ m_pinMap.at( aLibPin ) ].get(); @@ -1877,10 +1877,32 @@ void SCH_SYMBOL::Plot( PLOTTER* aPlotter ) const { if( m_part ) { + LIB_PINS libPins; + m_part->GetPins( libPins, GetUnit(), GetConvert() ); + + // Copy the source so we can re-orient and translate it. + LIB_SYMBOL tempSymbol( *m_part ); + LIB_PINS tempPins; + tempSymbol.GetPins( tempPins, GetUnit(), GetConvert() ); + + // 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() ); + + if( symbolPin->IsDangling() ) + tempPin->SetFlags( IS_DANGLING ); + } + TRANSFORM temp = GetTransform(); aPlotter->StartBlock( nullptr ); - m_part->Plot( aPlotter, GetUnit(), GetConvert(), m_pos, temp ); + tempSymbol.Plot( aPlotter, GetUnit(), GetConvert(), m_pos, temp ); for( SCH_FIELD field : m_fields ) field.Plot( aPlotter ); diff --git a/eeschema/sch_symbol.h b/eeschema/sch_symbol.h index 71791d793c..02978d1a22 100644 --- a/eeschema/sch_symbol.h +++ b/eeschema/sch_symbol.h @@ -456,7 +456,7 @@ public: */ void GetLibPins( std::vector& aPinsList ) const; - SCH_PIN* GetPin( LIB_PIN* aLibPin ); + SCH_PIN* GetPin( LIB_PIN* aLibPin ) const; /** * Retrieve a list of the SCH_PINs for the given sheet path.