pcbnew: Prevent extra selection

We want to avoid selecting items that are disabled in the item list.
Our standard method is in the GetViewLOD() that performs both size and
visibility.  This extends the check to module text and via.

Fixes: lp:1851133
* https://bugs.launchpad.net/kicad/+bug/1851133
This commit is contained in:
Seth Hillbrand 2019-11-05 06:20:50 -08:00 committed by Seth Hillbrand
parent 383adaa6f4
commit 19c643b29a
2 changed files with 30 additions and 2 deletions

View File

@ -738,8 +738,35 @@ unsigned int VIA::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const
BOARD* board = GetBoard(); BOARD* board = GetBoard();
// Only draw the via if at least one of the layers it crosses is being displayed // Only draw the via if at least one of the layers it crosses is being displayed
if( board && ( board->GetVisibleLayers() & GetLayerSet() ).any() ) if( board && ( board->GetVisibleLayers() & GetLayerSet() ).any()
&& aView->IsLayerVisible( LAYER_VIAS ) )
{
switch( m_ViaType )
{
case VIA_THROUGH:
if( !aView->IsLayerVisible( LAYER_VIA_THROUGH ) )
return HIDE;
break;
case VIA_BLIND_BURIED:
if( !aView->IsLayerVisible( LAYER_VIA_BBLIND ) )
return HIDE;
break;
case VIA_MICROVIA:
if( !aView->IsLayerVisible( LAYER_VIA_MICROVIA ) )
return HIDE;
break;
default:
break;
}
return 0; return 0;
}
return HIDE; return HIDE;
} }

View File

@ -1666,7 +1666,8 @@ bool SELECTION_TOOL::Selectable( const BOARD_ITEM* aItem, bool checkVisibilityOn
} }
// All other items are selected only if the layer on which they exist is visible // All other items are selected only if the layer on which they exist is visible
return board()->IsLayerVisible( aItem->GetLayer() ); return board()->IsLayerVisible( aItem->GetLayer() )
&& aItem->ViewGetLOD( aItem->GetLayer(), view() ) < view()->GetScale();
} }