From 78a6c1a909c9e46507a87fecb1a9b3b185b73d7c Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 15 Sep 2023 17:43:43 +0100 Subject: [PATCH] Smarten the UpdateAllItemsConditionally() tests in SetActiveLayer(). Fixes https://gitlab.com/kicad/code/kicad/-/issues/15329 (cherry picked from commit 5842e9c57e5837ac486e794728f7f25aec430c00) --- pcbnew/pcb_edit_frame.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index dbc4f84c61..f782323384 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -1350,11 +1350,22 @@ void PCB_EDIT_FRAME::SetActiveLayer( PCB_LAYER_ID aLayer ) { 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 ) { PAD* pad = static_cast( item ); + if( pad->GetRemoveUnconnected() ) + return KIGFX::ALL; + // Clearances could be layer-dependent so redraw them when the active layer // is changed if( GetPcbNewSettings()->m_Display.m_PadClearance )