Only override color if net or netclass color is set.
Fixes https://gitlab.com/kicad/code/kicad/issues/5368
This commit is contained in:
parent
007580c4b8
commit
8ffad4b375
|
@ -268,23 +268,38 @@ COLOR4D PCB_RENDER_SETTINGS::GetColor( const VIEW_ITEM* aItem, int aLayer ) cons
|
||||||
// Apply net color overrides
|
// Apply net color overrides
|
||||||
if( conItem && m_netColorMode == NET_COLOR_MODE::ALL && IsNetCopperLayer( aLayer ) )
|
if( conItem && m_netColorMode == NET_COLOR_MODE::ALL && IsNetCopperLayer( aLayer ) )
|
||||||
{
|
{
|
||||||
if( m_netColors.count( netCode ) )
|
COLOR4D netColor = COLOR4D::UNSPECIFIED;
|
||||||
color = m_netColors.at( netCode );
|
|
||||||
else if( m_netclassColors.count( conItem->GetNetClassName() ) )
|
|
||||||
color = m_netclassColors.at( conItem->GetNetClassName() );
|
|
||||||
|
|
||||||
if( item->IsSelected() )
|
auto ii = m_netColors.find( netCode );
|
||||||
|
|
||||||
|
if( ii != m_netColors.end() )
|
||||||
|
netColor = ii->second;
|
||||||
|
|
||||||
|
if( netColor == COLOR4D::UNSPECIFIED )
|
||||||
{
|
{
|
||||||
// Selection brightening overrides highlighting
|
auto jj = m_netclassColors.find( conItem->GetNetClassName() );
|
||||||
color.Brighten( m_selectFactor );
|
|
||||||
|
if( jj != m_netclassColors.end() )
|
||||||
|
netColor = jj->second;
|
||||||
}
|
}
|
||||||
else if( m_highlightEnabled )
|
|
||||||
|
if( netColor != COLOR4D::UNSPECIFIED )
|
||||||
{
|
{
|
||||||
// Highlight brightens objects on all layers and darkens everything else for contrast
|
if( item->IsSelected() )
|
||||||
if( highlighted )
|
{
|
||||||
color.Brighten( m_highlightFactor );
|
// Selection brightening overrides highlighting
|
||||||
else
|
netColor.Brighten( m_selectFactor );
|
||||||
color.Darken( 1.0 - m_highlightFactor );
|
}
|
||||||
|
else if( m_highlightEnabled )
|
||||||
|
{
|
||||||
|
// Highlight brightens objects on all layers and darkens everything else for contrast
|
||||||
|
if( highlighted )
|
||||||
|
netColor.Brighten( m_highlightFactor );
|
||||||
|
else
|
||||||
|
netColor.Darken( 1.0 - m_highlightFactor );
|
||||||
|
}
|
||||||
|
|
||||||
|
color = netColor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if( !item->IsSelected() && m_highlightEnabled )
|
else if( !item->IsSelected() && m_highlightEnabled )
|
||||||
|
|
Loading…
Reference in New Issue