From e5ea37507c48c5c3bbfb6798591c6f84b50c0112 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sat, 12 Mar 2022 23:28:34 +0000 Subject: [PATCH] Exclude hidden text from selection in FP Editor. Fixes https://gitlab.com/kicad/code/kicad/issues/11111 (cherry picked from commit 06c1bccccd48e4c84cb7d3d36c49f726742c740c) --- pcbnew/tools/pcb_selection_tool.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pcbnew/tools/pcb_selection_tool.cpp b/pcbnew/tools/pcb_selection_tool.cpp index 424758f6de..2dc11587f2 100644 --- a/pcbnew/tools/pcb_selection_tool.cpp +++ b/pcbnew/tools/pcb_selection_tool.cpp @@ -2087,6 +2087,7 @@ bool PCB_SELECTION_TOOL::Selectable( const BOARD_ITEM* aItem, bool checkVisibili const ZONE* zone = nullptr; const PCB_VIA* via = nullptr; const PAD* pad = nullptr; + const FP_TEXT* text = nullptr; switch( aItem->Type() ) { @@ -2145,6 +2146,11 @@ bool PCB_SELECTION_TOOL::Selectable( const BOARD_ITEM* aItem, bool checkVisibili case PCB_FP_TEXT_T: if( m_isFootprintEditor ) { + text = static_cast( aItem ); + + if( !text->IsVisible() && !view()->IsLayerVisible( LAYER_MOD_TEXT_INVISIBLE ) ) + return false; + if( !view()->IsLayerVisible( aItem->GetLayer() ) ) return false; }