While flags are in prefs, actual clearance values are in board setup.

Fixes https://gitlab.com/kicad/code/kicad/issues/10852
This commit is contained in:
Jeff Young 2022-02-15 21:59:46 +00:00
parent fc5772ad92
commit 7ddd3137a3
1 changed files with 17 additions and 2 deletions

View File

@ -1028,11 +1028,26 @@ void PCB_EDIT_FRAME::ShowBoardSetupDialog( const wxString& aInitialPage )
Kiway().CommonSettingsChanged( false, true ); Kiway().CommonSettingsChanged( false, true );
PCBNEW_SETTINGS* settings = GetPcbNewSettings();
GetCanvas()->GetView()->UpdateAllItemsConditionally( KIGFX::REPAINT, GetCanvas()->GetView()->UpdateAllItemsConditionally( KIGFX::REPAINT,
[&]( KIGFX::VIEW_ITEM* aItem ) -> bool [&]( KIGFX::VIEW_ITEM* aItem ) -> bool
{ {
if( dynamic_cast<EDA_TEXT*>( aItem ) ) if( dynamic_cast<PCB_TRACK*>( aItem ) )
{
if( settings->m_Display.m_PadClearance )
return true; // clearance values
}
else if( dynamic_cast<PAD*>( aItem ) )
{
if( settings->m_Display.m_TrackClearance == SHOW_WITH_VIA_ALWAYS )
return true; // clearance values
}
else if( dynamic_cast<EDA_TEXT*>( aItem ) )
{
if( dynamic_cast<EDA_TEXT*>( aItem )->HasTextVars() )
return true; // text variables return true; // text variables
}
return false; return false;
} ); } );