Fall back on copper color when net color is not found
Fixes https://gitlab.com/kicad/code/kicad/-/issues/5540
This commit is contained in:
parent
d6be0be177
commit
4433259c80
|
@ -283,24 +283,24 @@ COLOR4D PCB_RENDER_SETTINGS::GetColor( const VIEW_ITEM* aItem, int aLayer ) cons
|
||||||
netColor = jj->second;
|
netColor = jj->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( netColor != COLOR4D::UNSPECIFIED )
|
if( netColor == COLOR4D::UNSPECIFIED )
|
||||||
{
|
netColor = color;
|
||||||
if( item->IsSelected() )
|
|
||||||
{
|
|
||||||
// Selection brightening overrides highlighting
|
|
||||||
netColor.Brighten( m_selectFactor );
|
|
||||||
}
|
|
||||||
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;
|
if( item->IsSelected() )
|
||||||
|
{
|
||||||
|
// Selection brightening overrides highlighting
|
||||||
|
netColor.Brighten( m_selectFactor );
|
||||||
}
|
}
|
||||||
|
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