Browse Source

Draw ratsnest with colors if color data is available

pull/16/head
Jon Evans 6 years ago
parent
commit
d248736f08
  1. 2
      pcbnew/pcb_painter.cpp
  2. 17
      pcbnew/ratsnest/ratsnest_viewitem.cpp

2
pcbnew/pcb_painter.cpp

@ -238,8 +238,6 @@ void PCB_RENDER_SETTINGS::LoadNetSettings( const NET_SETTINGS& aSettings, const
}
m_hiddenNets = aHiddenNets;
}

17
pcbnew/ratsnest/ratsnest_viewitem.cpp

@ -84,7 +84,7 @@ void RATSNEST_VIEWITEM::ViewDraw( int aLayer, KIGFX::VIEW* aView ) const
std::set<int> highlightedNets = rs->GetHighlightNetCodes();
const std::set<int>& hiddenNets = rs->GetHiddenNets();
gal->SetStrokeColor( color.Brightened(0.5) );
std::map<int, KIGFX::COLOR4D>& netColors = rs->GetNetColorMap();
const bool curved_ratsnest = rs->GetCurvedRatsnestLinesEnabled();
@ -94,6 +94,13 @@ void RATSNEST_VIEWITEM::ViewDraw( int aLayer, KIGFX::VIEW* aView ) const
if( hiddenNets.count( l.netCode ) )
continue;
if( colorByNet && netColors.count( l.netCode ) )
color = netColors.at( l.netCode );
else
color = defaultColor;
gal->SetStrokeColor( color.Brightened( 0.5 ) );
if ( l.a == l.b )
{
gal->DrawLine( VECTOR2I( l.a.x - CROSS_SIZE, l.a.y - CROSS_SIZE ),
@ -128,10 +135,10 @@ void RATSNEST_VIEWITEM::ViewDraw( int aLayer, KIGFX::VIEW* aView ) const
if( !net )
continue;
if( colorByNet )
{
// TODO(JE) - RN_NET to net name / netclass name link
}
if( colorByNet && netColors.count( i ) )
color = netColors.at( i );
else
color = defaultColor;
// Draw the "static" ratsnest
if( highlightedNets.count( i ) )

Loading…
Cancel
Save