Pay attention to flashed layers when doing DRC layer switch.
Fixes https://gitlab.com/kicad/code/kicad/issues/6710
This commit is contained in:
parent
b89377a15d
commit
af841d1318
|
@ -303,6 +303,28 @@ void DIALOG_DRC::OnDRCItemSelected( wxDataViewEvent& aEvent )
|
||||||
const KIID& itemID = node ? RC_TREE_MODEL::ToUUID( aEvent.GetItem() ) : niluuid;
|
const KIID& itemID = node ? RC_TREE_MODEL::ToUUID( aEvent.GetItem() ) : niluuid;
|
||||||
BOARD_ITEM* item = board->GetItem( itemID );
|
BOARD_ITEM* item = board->GetItem( itemID );
|
||||||
|
|
||||||
|
auto getActiveLayers =
|
||||||
|
[]( BOARD_ITEM* aItem ) -> LSET
|
||||||
|
{
|
||||||
|
if( aItem->Type() == PCB_PAD_T )
|
||||||
|
{
|
||||||
|
PAD* pad = static_cast<PAD*>( aItem );
|
||||||
|
LSET layers;
|
||||||
|
|
||||||
|
for( int layer : aItem->GetLayerSet().Seq() )
|
||||||
|
{
|
||||||
|
if( pad->FlashLayer( layer ) )
|
||||||
|
layers.set( layer );
|
||||||
|
}
|
||||||
|
|
||||||
|
return layers;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return aItem->GetLayerSet();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
if( item && node )
|
if( item && node )
|
||||||
{
|
{
|
||||||
PCB_LAYER_ID principalLayer = item->GetLayer();
|
PCB_LAYER_ID principalLayer = item->GetLayer();
|
||||||
|
@ -335,16 +357,16 @@ void DIALOG_DRC::OnDRCItemSelected( wxDataViewEvent& aEvent )
|
||||||
BOARD_ITEM* d = board->GetItem( rc_item->GetAuxItem3ID() );
|
BOARD_ITEM* d = board->GetItem( rc_item->GetAuxItem3ID() );
|
||||||
|
|
||||||
if( a )
|
if( a )
|
||||||
violationLayers &= a->GetLayerSet();
|
violationLayers &= getActiveLayers( a );
|
||||||
|
|
||||||
if( b )
|
if( b )
|
||||||
violationLayers &= b->GetLayerSet();
|
violationLayers &= getActiveLayers( b );
|
||||||
|
|
||||||
if( c )
|
if( c )
|
||||||
violationLayers &= c->GetLayerSet();
|
violationLayers &= getActiveLayers( c );
|
||||||
|
|
||||||
if( d )
|
if( d )
|
||||||
violationLayers &= d->GetLayerSet();
|
violationLayers &= getActiveLayers( d );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( violationLayers.count() )
|
if( violationLayers.count() )
|
||||||
|
|
Loading…
Reference in New Issue