Fix missing current scale in AC simulation

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18313
This commit is contained in:
Pilatomic 2024-07-01 22:22:08 +02:00
parent 7608be0bc0
commit 11eb55d87f
1 changed files with 3 additions and 1 deletions

View File

@ -916,7 +916,9 @@ void SIM_PLOT_TAB::SetTraceData( TRACE* trace, std::vector<double>& aX, std::vec
trace->SetSweepCount( aSweepCount );
trace->SetSweepSize( aSweepSize );
if( ( trace->GetType() & SPT_AC_PHASE ) || ( trace->GetType() & SPT_CURRENT ) )
// Phase and currents on second Y axis, except for AC currents, those use the same axis as voltage
if( ( trace->GetType() & SPT_AC_PHASE )
|| ( ( GetSimType() != ST_AC ) && ( trace->GetType() & SPT_CURRENT ) ) )
trace->SetScale( m_axis_x, m_axis_y2 );
else if( trace->GetType() & SPT_POWER )
trace->SetScale( m_axis_x, m_axis_y3 );