Selection will always be the same after choice in toolbar popup.

Fixes https://gitlab.com/kicad/code/kicad/issues/12769
This commit is contained in:
Jeff Young 2022-10-27 11:06:12 +01:00
parent ef17ee3384
commit 53796f2be6
1 changed files with 1 additions and 1 deletions

View File

@ -470,7 +470,7 @@ void EDA_3D_VIEWER_FRAME::applyViewport( const wxString& aViewportName )
{
int idx = m_cbViewports->FindString( aViewportName );
if( idx >= 0 )
if( idx >= 0 && idx < m_cbViewports->GetCount() - 3 /* separator */ )
{
m_cbViewports->SetSelection( idx );
m_lastSelectedViewport = static_cast<VIEWPORT3D*>( m_cbViewports->GetClientData( idx ) );