Avoid assertion with invalid width

After adjusting col 0, the new width might be too large to handle.  In
which case, allow the system to choose our best width
This commit is contained in:
Seth Hillbrand 2020-11-19 15:17:56 -08:00
parent 0d850f98cd
commit c9fb595f64
1 changed files with 7 additions and 1 deletions

View File

@ -800,7 +800,13 @@ void PANEL_SYM_LIB_TABLE::adjustPathSubsGridColumns( int aWidth )
aWidth -= ( m_path_subs_grid->GetSize().x - m_path_subs_grid->GetClientSize().x );
m_path_subs_grid->AutoSizeColumn( 0 );
m_path_subs_grid->SetColSize( 1, aWidth - m_path_subs_grid->GetColSize( 0 ) );
int remaining_width = aWidth - m_path_subs_grid->GetColSize( 0 );
if( remaining_width < 0 )
m_path_subs_grid->SetColSize( 1, -1 );
else
m_path_subs_grid->SetColSize( 1, remaining_width );
}