Exclude hidden text from selection in FP Editor.

Fixes https://gitlab.com/kicad/code/kicad/issues/11111

(cherry picked from commit 06c1bccccd)
This commit is contained in:
Jeff Young 2022-03-12 23:28:34 +00:00
parent 53bd87d792
commit e5ea37507c
1 changed files with 6 additions and 0 deletions

View File

@ -2087,6 +2087,7 @@ bool PCB_SELECTION_TOOL::Selectable( const BOARD_ITEM* aItem, bool checkVisibili
const ZONE* zone = nullptr; const ZONE* zone = nullptr;
const PCB_VIA* via = nullptr; const PCB_VIA* via = nullptr;
const PAD* pad = nullptr; const PAD* pad = nullptr;
const FP_TEXT* text = nullptr;
switch( aItem->Type() ) switch( aItem->Type() )
{ {
@ -2145,6 +2146,11 @@ bool PCB_SELECTION_TOOL::Selectable( const BOARD_ITEM* aItem, bool checkVisibili
case PCB_FP_TEXT_T: case PCB_FP_TEXT_T:
if( m_isFootprintEditor ) if( m_isFootprintEditor )
{ {
text = static_cast<const FP_TEXT*>( aItem );
if( !text->IsVisible() && !view()->IsLayerVisible( LAYER_MOD_TEXT_INVISIBLE ) )
return false;
if( !view()->IsLayerVisible( aItem->GetLayer() ) ) if( !view()->IsLayerVisible( aItem->GetLayer() ) )
return false; return false;
} }