If magnitude or phase is specified, don't add both.

Fixes https://gitlab.com/kicad/code/kicad/issues/13202
This commit is contained in:
Jeff Young 2022-12-28 10:09:14 +00:00
parent 508b9e21a8
commit e11d39b0f2
1 changed files with 10 additions and 3 deletions

View File

@ -688,9 +688,16 @@ void SIM_PLOT_FRAME::addPlot( const wxString& aName, SIM_PLOT_TYPE aType )
{
int baseType = aType & ~( SPT_AC_MAG | SPT_AC_PHASE );
// Add two plots: magnitude & phase
updated |= updatePlot( aName, ( SIM_PLOT_TYPE )( baseType | SPT_AC_MAG ), plotPanel );
updated |= updatePlot( aName, ( SIM_PLOT_TYPE )( baseType | SPT_AC_PHASE ), plotPanel );
// If magnitude or phase wasn't specified, then add both
if( baseType == aType )
{
updated |= updatePlot( aName, ( SIM_PLOT_TYPE )( baseType | SPT_AC_MAG ), plotPanel );
updated |= updatePlot( aName, ( SIM_PLOT_TYPE )( baseType | SPT_AC_PHASE ), plotPanel );
}
else
{
updated |= updatePlot( aName, ( SIM_PLOT_TYPE )( aType ), plotPanel );
}
}
else
{