Smarten the UpdateAllItemsConditionally() tests in SetActiveLayer().

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15329

(cherry picked from commit 5842e9c57e)
This commit is contained in:
Jeff Young 2023-09-15 17:43:43 +01:00
parent c858643100
commit 78a6c1a909
1 changed files with 11 additions and 0 deletions

View File

@ -1350,11 +1350,22 @@ void PCB_EDIT_FRAME::SetActiveLayer( PCB_LAYER_ID aLayer )
{ {
return KIGFX::REPAINT; return KIGFX::REPAINT;
} }
if( via->GetRemoveUnconnected() )
return KIGFX::ALL;
// Clearances could be layer-dependent so redraw them when the active layer
// is changed
if( GetPcbNewSettings()->m_Display.m_TrackClearance == SHOW_WITH_VIA_ALWAYS )
return KIGFX::REPAINT;
} }
else if( item->Type() == PCB_PAD_T ) else if( item->Type() == PCB_PAD_T )
{ {
PAD* pad = static_cast<PAD*>( item ); PAD* pad = static_cast<PAD*>( item );
if( pad->GetRemoveUnconnected() )
return KIGFX::ALL;
// Clearances could be layer-dependent so redraw them when the active layer // Clearances could be layer-dependent so redraw them when the active layer
// is changed // is changed
if( GetPcbNewSettings()->m_Display.m_PadClearance ) if( GetPcbNewSettings()->m_Display.m_PadClearance )