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

This commit is contained in:
charras 2009-05-25 14:14:54 +00:00
parent 3f970c85ce
commit b13267f496
2 changed files with 22 additions and 6 deletions

View File

@ -175,17 +175,14 @@ void NETINFO_ITEM::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int aDrawMode, const
/***********************/ /***********************/
/** function Draw /** 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 ) 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, GRLine( &panel->m_ClipBox, DC, m_PadStart->m_Pos.x + aOffset.x,
m_PadStart->m_Pos.y + aOffset.y, m_PadStart->m_Pos.y + aOffset.y,
m_PadEnd->m_Pos.x + aOffset.x, m_PadEnd->m_Pos.x + aOffset.x,
m_PadEnd->m_Pos.y + aOffset.y, m_PadEnd->m_Pos.y + aOffset.y,
0, color ); 0, g_DesignSettings.m_RatsnestColor );
} }

View File

@ -1041,11 +1041,30 @@ void WinEDA_BasePcbFrame::trace_ratsnest_module( wxDC* DC )
local_chevelu = local_liste_chevelu; local_chevelu = local_liste_chevelu;
ii = nb_local_chevelu; ii = nb_local_chevelu;
GRSetDrawMode( DC, GR_XOR );
int tmpcolor = g_DesignSettings.m_RatsnestColor;
wxPoint offset = -g_Offset_Module;
while( ii-- > 0 ) 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++; local_chevelu++;
} }
g_DesignSettings.m_RatsnestColor = tmpcolor;
} }