From c9fb595f646cfc2b0036f7acaaaaa29712c0d7ce Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Thu, 19 Nov 2020 15:17:56 -0800 Subject: [PATCH] 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 --- eeschema/dialogs/panel_sym_lib_table.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/eeschema/dialogs/panel_sym_lib_table.cpp b/eeschema/dialogs/panel_sym_lib_table.cpp index 9f46fead70..7765b3b47c 100644 --- a/eeschema/dialogs/panel_sym_lib_table.cpp +++ b/eeschema/dialogs/panel_sym_lib_table.cpp @@ -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 ); }