mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 18:23:15 +02:00
Minor improvements to layer highlighting.
This commit is contained in:
parent
df80f6484e
commit
06a0094597
@ -783,6 +783,22 @@ inline bool IsNonCopperLayer( LAYER_NUM aLayerId )
|
|||||||
return aLayerId > B_Cu && aLayerId <= PCB_LAYER_ID_COUNT;
|
return aLayerId > B_Cu && aLayerId <= PCB_LAYER_ID_COUNT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tests whether a layer is a copper layer, optionally including synthetic copper layers such
|
||||||
|
* as LAYER_VIA_THROUGH, LAYER_PAD_FR, etc.
|
||||||
|
*
|
||||||
|
* @param aLayerId
|
||||||
|
* @param aIncludeSyntheticCopperLayers
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
inline bool IsCopperLayer( LAYER_NUM aLayerId, bool aIncludeSyntheticCopperLayers )
|
||||||
|
{
|
||||||
|
if( aIncludeSyntheticCopperLayers )
|
||||||
|
return !IsNonCopperLayer( aLayerId );
|
||||||
|
else
|
||||||
|
return IsCopperLayer( aLayerId );
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test whether a layer is a non copper and a non tech layer.
|
* Test whether a layer is a non copper and a non tech layer.
|
||||||
*
|
*
|
||||||
|
@ -346,7 +346,7 @@ COLOR4D PCB_RENDER_SETTINGS::GetColor( const VIEW_ITEM* aItem, int aLayer ) cons
|
|||||||
// m_highContrastLayers, but it's not sufficiently fine-grained as it can't differentiate
|
// m_highContrastLayers, but it's not sufficiently fine-grained as it can't differentiate
|
||||||
// between (for instance) a via which is flashed on the primary layer and one that is not.
|
// between (for instance) a via which is flashed on the primary layer and one that is not.
|
||||||
// So we need to refine isActive to be more discriminating for some items.
|
// So we need to refine isActive to be more discriminating for some items.
|
||||||
if( primary != UNDEFINED_LAYER && IsCopperLayer( primary ) )
|
if( IsCopperLayer( primary ) )
|
||||||
{
|
{
|
||||||
if( item->Type() == PCB_TRACE_T || item->Type() == PCB_ARC_T )
|
if( item->Type() == PCB_TRACE_T || item->Type() == PCB_ARC_T )
|
||||||
{
|
{
|
||||||
@ -364,8 +364,9 @@ COLOR4D PCB_RENDER_SETTINGS::GetColor( const VIEW_ITEM* aItem, int aLayer ) cons
|
|||||||
flashed = static_cast<const PAD*>( item )->FlashLayer( primary, true );
|
flashed = static_cast<const PAD*>( item )->FlashLayer( primary, true );
|
||||||
|
|
||||||
// For pads and vias, we only want to override the active state for copper layers
|
// For pads and vias, we only want to override the active state for copper layers
|
||||||
// (this includes synthetic layers)
|
// (both board copper layers such as F_Cu *and* synthetic copper layers such as
|
||||||
if( !IsNonCopperLayer( aLayer ) )
|
// LAYER_VIA_THROUGH).
|
||||||
|
if( IsCopperLayer( aLayer, true ) )
|
||||||
isActive = flashed;
|
isActive = flashed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user