From 718b7e744a408791d373a482895e15dfa533a1ed Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Sun, 13 Jul 2025 18:13:16 -0400 Subject: [PATCH] Do not allow selection of excluded DRC markers when they are not visible. Fixes https://gitlab.com/kicad/code/kicad/-/issues/21265 --- pcbnew/tools/pcb_selection_tool.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pcbnew/tools/pcb_selection_tool.cpp b/pcbnew/tools/pcb_selection_tool.cpp index 2de3094354..0e2aaa7a84 100644 --- a/pcbnew/tools/pcb_selection_tool.cpp +++ b/pcbnew/tools/pcb_selection_tool.cpp @@ -2993,6 +2993,7 @@ bool PCB_SELECTION_TOOL::Selectable( const BOARD_ITEM* aItem, bool checkVisibili const PAD* pad = nullptr; const PCB_TEXT* text = nullptr; const PCB_FIELD* field = nullptr; + const PCB_MARKER* marker = nullptr; // Most footprint children can only be selected in the footprint editor. if( aItem->GetParentFootprint() && !m_isFootprintEditor && !checkVisibilityOnly ) @@ -3147,6 +3148,14 @@ bool PCB_SELECTION_TOOL::Selectable( const BOARD_ITEM* aItem, bool checkVisibili break; + case PCB_MARKER_T: + marker = static_cast( aItem ); + + if( marker && marker->IsExcluded() && !board()->IsElementVisible( LAYER_DRC_EXCLUSION ) ) + return false; + + break; + // These are not selectable case PCB_NETINFO_T: case NOT_USED: