From c7f69503c04f1e561da8d9d4635988733cdac52e Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 15 Sep 2023 13:41:56 +0100 Subject: [PATCH] Do full high-contrast update of vias & pads if netnames are shown. Fixes https://gitlab.com/kicad/code/kicad/-/issues/15657 --- pcbnew/pcb_base_frame.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/pcbnew/pcb_base_frame.cpp b/pcbnew/pcb_base_frame.cpp index 7124eb26bf..31e48ec163 100644 --- a/pcbnew/pcb_base_frame.cpp +++ b/pcbnew/pcb_base_frame.cpp @@ -1117,6 +1117,11 @@ void PCB_BASE_FRAME::SetDisplayOptions( const PCB_DISPLAY_OPTIONS& aOptions, boo // Vias on a restricted layer set must be redrawn when high contrast mode is changed if( hcChanged ) { + bool showNetNames = false; + + if( PCBNEW_SETTINGS* config = dynamic_cast( Kiface().KifaceSettings() ) ) + showNetNames = config->m_Display.m_NetNames > 0; + // Note: KIGFX::REPAINT isn't enough for things that go from invisible to visible as // they won't be found in the view layer's itemset for re-painting. GetCanvas()->GetView()->UpdateAllItemsConditionally( @@ -1126,15 +1131,19 @@ void PCB_BASE_FRAME::SetDisplayOptions( const PCB_DISPLAY_OPTIONS& aOptions, boo { if( via->GetViaType() == VIATYPE::BLIND_BURIED || via->GetViaType() == VIATYPE::MICROVIA - || via->GetRemoveUnconnected() ) + || via->GetRemoveUnconnected() + || showNetNames ) { return hcVisChanged ? KIGFX::ALL : KIGFX::REPAINT; } } else if( PAD* pad = dynamic_cast( aItem ) ) { - if( pad->GetRemoveUnconnected() ) + if( pad->GetRemoveUnconnected() + || showNetNames ) + { return hcVisChanged ? KIGFX::ALL : KIGFX::REPAINT; + } } return 0;