Shadow on locked fp: do not show if LAYER_MOD_FR or LAYER_MOD_BK is not shown

This commit is contained in:
jean-pierre charras 2022-04-12 11:17:04 +02:00
parent 819276bd98
commit 74c3ad0b3a
1 changed files with 10 additions and 1 deletions

View File

@ -1433,8 +1433,17 @@ void FOOTPRINT::ViewGetLayers( int aLayers[], int& aCount ) const
double FOOTPRINT::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const
{
if( aLayer == LAYER_LOCKED_ITEM_SHADOW )
{
// The locked shadow shape is shown only if the footprint itself is visible
if( ( m_layer == F_Cu ) && aView->IsLayerVisible( LAYER_MOD_FR ) )
return 0.0;
if( ( m_layer == B_Cu ) && aView->IsLayerVisible( LAYER_MOD_BK ) )
return 0.0;
return std::numeric_limits<double>::max();
}
int layer = ( m_layer == F_Cu ) ? LAYER_MOD_FR :
( m_layer == B_Cu ) ? LAYER_MOD_BK : LAYER_ANCHOR;