Use LAYER_VIAS instead of via-type-specific layers for visibility.
Fixes https://gitlab.com/kicad/code/kicad/issues/5344
This commit is contained in:
parent
502f2ca2ef
commit
8eda4d93ee
|
@ -629,13 +629,7 @@ unsigned int VIA::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const
|
||||||
if( !onVisibleLayer && m_ViaType != VIATYPE::THROUGH )
|
if( !onVisibleLayer && m_ViaType != VIATYPE::THROUGH )
|
||||||
return HIDE;
|
return HIDE;
|
||||||
|
|
||||||
switch( m_ViaType )
|
return aView->IsLayerVisible( LAYER_VIAS ) ? 0 : HIDE;
|
||||||
{
|
|
||||||
case VIATYPE::THROUGH: return aView->IsLayerVisible( LAYER_VIA_THROUGH ) ? 0 : HIDE;
|
|
||||||
case VIATYPE::BLIND_BURIED: return aView->IsLayerVisible( LAYER_VIA_BBLIND ) ? 0 : HIDE;
|
|
||||||
case VIATYPE::MICROVIA: return aView->IsLayerVisible( LAYER_VIA_MICROVIA ) ? 0 : HIDE;
|
|
||||||
default: return 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return HIDE;
|
return HIDE;
|
||||||
|
|
|
@ -452,9 +452,9 @@ GENERAL_COLLECTORS_GUIDE PCB_BASE_FRAME::GetCollectorsGuide()
|
||||||
guide.SetIgnoreThroughHolePads( ! m_Pcb->IsElementVisible( LAYER_PADS_TH ) );
|
guide.SetIgnoreThroughHolePads( ! m_Pcb->IsElementVisible( LAYER_PADS_TH ) );
|
||||||
guide.SetIgnoreModulesVals( ! m_Pcb->IsElementVisible( LAYER_MOD_VALUES ) );
|
guide.SetIgnoreModulesVals( ! m_Pcb->IsElementVisible( LAYER_MOD_VALUES ) );
|
||||||
guide.SetIgnoreModulesRefs( ! m_Pcb->IsElementVisible( LAYER_MOD_REFERENCES ) );
|
guide.SetIgnoreModulesRefs( ! m_Pcb->IsElementVisible( LAYER_MOD_REFERENCES ) );
|
||||||
guide.SetIgnoreThroughVias( ! m_Pcb->IsElementVisible( LAYER_VIA_THROUGH ) );
|
guide.SetIgnoreThroughVias( ! m_Pcb->IsElementVisible( LAYER_VIAS ) );
|
||||||
guide.SetIgnoreBlindBuriedVias( ! m_Pcb->IsElementVisible( LAYER_VIA_BBLIND ) );
|
guide.SetIgnoreBlindBuriedVias( ! m_Pcb->IsElementVisible( LAYER_VIAS ) );
|
||||||
guide.SetIgnoreMicroVias( ! m_Pcb->IsElementVisible( LAYER_VIA_MICROVIA ) );
|
guide.SetIgnoreMicroVias( ! m_Pcb->IsElementVisible( LAYER_VIAS ) );
|
||||||
guide.SetIgnoreTracks( ! m_Pcb->IsElementVisible( LAYER_TRACKS ) );
|
guide.SetIgnoreTracks( ! m_Pcb->IsElementVisible( LAYER_TRACKS ) );
|
||||||
|
|
||||||
return guide;
|
return guide;
|
||||||
|
|
|
@ -152,10 +152,7 @@ void PCBNEW_PRINTOUT::setupViewLayers( KIGFX::VIEW& aView, const LSET& aLayerSet
|
||||||
setVisibility( LAYER_PADS_TH );
|
setVisibility( LAYER_PADS_TH );
|
||||||
|
|
||||||
setVisibility( LAYER_TRACKS );
|
setVisibility( LAYER_TRACKS );
|
||||||
setVisibility( LAYER_VIA_THROUGH );
|
setVisibility( LAYER_VIAS );
|
||||||
setVisibility( LAYER_VIA_BBLIND );
|
|
||||||
setVisibility( LAYER_VIA_MICROVIA );
|
|
||||||
setVisibility( LAYER_NON_PLATEDHOLES );
|
|
||||||
|
|
||||||
setVisibility( LAYER_NO_CONNECTS );
|
setVisibility( LAYER_NO_CONNECTS );
|
||||||
setVisibility( LAYER_DRC_WARNING );
|
setVisibility( LAYER_DRC_WARNING );
|
||||||
|
|
|
@ -463,9 +463,9 @@ const GENERAL_COLLECTORS_GUIDE SELECTION_TOOL::getCollectorsGuide() const
|
||||||
guide.SetIgnoreThroughHolePads( padsDisabled || ! board()->IsElementVisible( LAYER_PADS_TH ) );
|
guide.SetIgnoreThroughHolePads( padsDisabled || ! board()->IsElementVisible( LAYER_PADS_TH ) );
|
||||||
guide.SetIgnoreModulesVals( ! board()->IsElementVisible( LAYER_MOD_VALUES ) );
|
guide.SetIgnoreModulesVals( ! board()->IsElementVisible( LAYER_MOD_VALUES ) );
|
||||||
guide.SetIgnoreModulesRefs( ! board()->IsElementVisible( LAYER_MOD_REFERENCES ) );
|
guide.SetIgnoreModulesRefs( ! board()->IsElementVisible( LAYER_MOD_REFERENCES ) );
|
||||||
guide.SetIgnoreThroughVias( ! board()->IsElementVisible( LAYER_VIA_THROUGH ) );
|
guide.SetIgnoreThroughVias( ! board()->IsElementVisible( LAYER_VIAS ) );
|
||||||
guide.SetIgnoreBlindBuriedVias( ! board()->IsElementVisible( LAYER_VIA_BBLIND ) );
|
guide.SetIgnoreBlindBuriedVias( ! board()->IsElementVisible( LAYER_VIAS ) );
|
||||||
guide.SetIgnoreMicroVias( ! board()->IsElementVisible( LAYER_VIA_MICROVIA ) );
|
guide.SetIgnoreMicroVias( ! board()->IsElementVisible( LAYER_VIAS ) );
|
||||||
guide.SetIgnoreTracks( ! board()->IsElementVisible( LAYER_TRACKS ) );
|
guide.SetIgnoreTracks( ! board()->IsElementVisible( LAYER_TRACKS ) );
|
||||||
|
|
||||||
return guide;
|
return guide;
|
||||||
|
@ -1808,39 +1808,17 @@ bool SELECTION_TOOL::Selectable( const BOARD_ITEM* aItem, bool checkVisibilityOn
|
||||||
|
|
||||||
case PCB_TRACE_T:
|
case PCB_TRACE_T:
|
||||||
case PCB_ARC_T:
|
case PCB_ARC_T:
|
||||||
{
|
|
||||||
if( !board()->IsElementVisible( LAYER_TRACKS ) )
|
if( !board()->IsElementVisible( LAYER_TRACKS ) )
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PCB_VIA_T:
|
case PCB_VIA_T:
|
||||||
{
|
{
|
||||||
|
if( !board()->IsElementVisible( LAYER_VIAS ) )
|
||||||
|
return false;
|
||||||
|
|
||||||
const VIA* via = static_cast<const VIA*>( aItem );
|
const VIA* via = static_cast<const VIA*>( aItem );
|
||||||
|
|
||||||
// Check if appropriate element layer is visible
|
|
||||||
switch( via->GetViaType() )
|
|
||||||
{
|
|
||||||
case VIATYPE::THROUGH:
|
|
||||||
if( !board()->IsElementVisible( LAYER_VIA_THROUGH ) )
|
|
||||||
return false;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case VIATYPE::BLIND_BURIED:
|
|
||||||
if( !board()->IsElementVisible( LAYER_VIA_BBLIND ) )
|
|
||||||
return false;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case VIATYPE::MICROVIA:
|
|
||||||
if( !board()->IsElementVisible( LAYER_VIA_MICROVIA ) )
|
|
||||||
return false;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
wxFAIL;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// For vias it is enough if only one of its layers is visible
|
// For vias it is enough if only one of its layers is visible
|
||||||
return ( board()->GetVisibleLayers() & via->GetLayerSet() ).any();
|
return ( board()->GetVisibleLayers() & via->GetLayerSet() ).any();
|
||||||
}
|
}
|
||||||
|
@ -1855,19 +1833,19 @@ bool SELECTION_TOOL::Selectable( const BOARD_ITEM* aItem, bool checkVisibilityOn
|
||||||
|
|
||||||
MODULE* module = const_cast<MODULE*>( static_cast<const MODULE*>( aItem ) );
|
MODULE* module = const_cast<MODULE*>( static_cast<const MODULE*>( aItem ) );
|
||||||
|
|
||||||
for( auto item : module->GraphicalItems() )
|
for( BOARD_ITEM* item : module->GraphicalItems() )
|
||||||
{
|
{
|
||||||
if( Selectable( item, true ) )
|
if( Selectable( item, true ) )
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
for( auto pad : module->Pads() )
|
for( D_PAD* pad : module->Pads() )
|
||||||
{
|
{
|
||||||
if( Selectable( pad, true ) )
|
if( Selectable( pad, true ) )
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
for( auto zone : module->Zones() )
|
for( ZONE_CONTAINER* zone : module->Zones() )
|
||||||
{
|
{
|
||||||
if( Selectable( zone, true ) )
|
if( Selectable( zone, true ) )
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue