Commit b13267f4 authored by charras's avatar charras

more cleanup and enhancements about rats nest (work in progress)

parent 3f970c85
......@@ -175,17 +175,14 @@ void NETINFO_ITEM::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int aDrawMode, const
/***********************/
/** function Draw
* Draws a line from the starting pad to the ending pad
* Draws a line (a ratsnest) from the starting pad to the ending pad
*/
void RATSNEST_ITEM::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int aDrawMode, const wxPoint& aOffset )
{
EDA_Colors color = (EDA_Colors) g_DesignSettings.m_RatsnestColor;
if ( (m_Status & LOCAL_RATSNEST_ITEM) )
color = YELLOW;
GRLine( &panel->m_ClipBox, DC, m_PadStart->m_Pos.x + aOffset.x,
m_PadStart->m_Pos.y + aOffset.y,
m_PadEnd->m_Pos.x + aOffset.x,
m_PadEnd->m_Pos.y + aOffset.y,
0, color );
0, g_DesignSettings.m_RatsnestColor );
}
......@@ -1041,11 +1041,30 @@ void WinEDA_BasePcbFrame::trace_ratsnest_module( wxDC* DC )
local_chevelu = local_liste_chevelu;
ii = nb_local_chevelu;
GRSetDrawMode( DC, GR_XOR );
int tmpcolor = g_DesignSettings.m_RatsnestColor;
wxPoint offset = -g_Offset_Module;
while( ii-- > 0 )
{
local_chevelu->Draw( DrawPanel, DC, GR_XOR, wxPoint( 0, 0 ) );
if( local_chevelu->m_Status & LOCAL_RATSNEST_ITEM )
{
g_DesignSettings.m_RatsnestColor = YELLOW;
local_chevelu->Draw( DrawPanel, DC, GR_XOR, offset );
}
else
{
g_DesignSettings.m_RatsnestColor = tmpcolor;
GRLine( &DrawPanel->m_ClipBox, DC,
local_chevelu->m_PadStart->m_Pos.x + offset.x,
local_chevelu->m_PadStart->m_Pos.y + offset.y,
local_chevelu->m_PadEnd->m_Pos.x,
local_chevelu->m_PadEnd->m_Pos.y,
0, g_DesignSettings.m_RatsnestColor );
}
local_chevelu++;
}
g_DesignSettings.m_RatsnestColor = tmpcolor;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment