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:
parent
0d850f98cd
commit
c9fb595f64
|
@ -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 );
|
aWidth -= ( m_path_subs_grid->GetSize().x - m_path_subs_grid->GetClientSize().x );
|
||||||
|
|
||||||
m_path_subs_grid->AutoSizeColumn( 0 );
|
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 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue