From 7e58f1aa9f56f6c5af33431341741502b8493197 Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Sat, 2 Jan 2021 14:15:52 -0500 Subject: [PATCH] Fix display of pads in high contrast mode Fixes https://gitlab.com/kicad/code/kicad/-/issues/6912 --- pcbnew/pcb_edit_frame.cpp | 8 +++++++- pcbnew/pcb_painter.cpp | 6 ++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index 6788f2f280..02ff2b9266 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -977,7 +977,7 @@ void PCB_EDIT_FRAME::SetActiveLayer( PCB_LAYER_ID aLayer ) GetCanvas()->SetFocus(); // allow capture of hotkeys GetCanvas()->SetHighContrastLayer( aLayer ); - // Vias on a restricted layer set must be redrawn when the active layer is changed + // Pads and vias on a restricted layer set must be redrawn when the active layer is changed GetCanvas()->GetView()->UpdateAllItemsConditionally( KIGFX::REPAINT, []( KIGFX::VIEW_ITEM* aItem ) -> bool { @@ -986,6 +986,12 @@ void PCB_EDIT_FRAME::SetActiveLayer( PCB_LAYER_ID aLayer ) return ( via->GetViaType() == VIATYPE::BLIND_BURIED || via->GetViaType() == VIATYPE::MICROVIA ); } + else if( PAD* pad = dynamic_cast( aItem ) ) + { + // TODO: this could be optimized if the pad painter is changed + // See https://gitlab.com/kicad/code/kicad/-/issues/6912 + return true; + } return false; } ); diff --git a/pcbnew/pcb_painter.cpp b/pcbnew/pcb_painter.cpp index a59b3775a8..65c2b12e3f 100644 --- a/pcbnew/pcb_painter.cpp +++ b/pcbnew/pcb_painter.cpp @@ -936,6 +936,12 @@ void PCB_PAINTER::draw( const PAD* aPad, int aLayer ) draw_annular = true; break; } + else if( !IsCopperLayer( layer ) ) + { + // If a non-copper layer is the high-contrast layer, just show the pad + draw_annular = true; + break; + } } }