Commit 497cb9f7 authored by charras's avatar charras

code cleanup

parent b13267f4
...@@ -442,6 +442,11 @@ void GRLine( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, int x2, int y2, int wi ...@@ -442,6 +442,11 @@ void GRLine( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, int x2, int y2, int wi
width ), Color ); width ), Color );
} }
void GRLine(EDA_Rect * aClipBox, wxDC * aDC, wxPoint aStart, wxPoint aEnd, int aWidth, int aColor)
{
GRSLine( aClipBox, aDC, GRMapX( aStart.x ), GRMapY( aStart.y ), GRMapX( aEnd.x ), GRMapY( aEnd.y ),
ZoomValue( aWidth ), aColor );
}
/***************************************************/ /***************************************************/
/* Routine to draw a Dashed line, in Screen space. */ /* Routine to draw a Dashed line, in Screen space. */
......
...@@ -70,6 +70,7 @@ void GRForceBlackPen(bool flagforce ); ...@@ -70,6 +70,7 @@ void GRForceBlackPen(bool flagforce );
bool GetGRForceBlackPenState( void ); bool GetGRForceBlackPenState( void );
void SetPenMinWidth(int minwidth); /* ajustage de la largeur mini de plume */ void SetPenMinWidth(int minwidth); /* ajustage de la largeur mini de plume */
void GRLine(EDA_Rect * aClipBox, wxDC * aDC, wxPoint aStart, wxPoint aEnd, int aWidth, int aColor);
void GRLine(EDA_Rect * ClipBox, wxDC * DC, int x1, int y1, int x2, int y2, int width, int Color); void GRLine(EDA_Rect * ClipBox, wxDC * DC, int x1, int y1, int x2, int y2, int width, int Color);
void GRMixedLine(EDA_Rect * ClipBox, wxDC * DC, int x1, int y1, int x2, int y2, int width, int Color); void GRMixedLine(EDA_Rect * ClipBox, wxDC * DC, int x1, int y1, int x2, int y2, int width, int Color);
void GRSMixedLine(EDA_Rect * ClipBox, wxDC * DC, int x1, int y1, int x2, int y2, int width, int Color); void GRSMixedLine(EDA_Rect * ClipBox, wxDC * DC, int x1, int y1, int x2, int y2, int width, int Color);
......
...@@ -179,10 +179,7 @@ void NETINFO_ITEM::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int aDrawMode, const ...@@ -179,10 +179,7 @@ void NETINFO_ITEM::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int aDrawMode, const
*/ */
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 )
{ {
GRLine( &panel->m_ClipBox, DC, m_PadStart->m_Pos.x + aOffset.x, GRLine( &panel->m_ClipBox, DC, m_PadStart->m_Pos - aOffset,
m_PadStart->m_Pos.y + aOffset.y, m_PadEnd->m_Pos - aOffset, 0, g_DesignSettings.m_RatsnestColor );
m_PadEnd->m_Pos.x + aOffset.x,
m_PadEnd->m_Pos.y + aOffset.y,
0, g_DesignSettings.m_RatsnestColor );
} }
...@@ -767,7 +767,7 @@ void WinEDA_BasePcbFrame::Tst_Ratsnest( wxDC* DC, int ref_netcode ) ...@@ -767,7 +767,7 @@ void WinEDA_BasePcbFrame::Tst_Ratsnest( wxDC* DC, int ref_netcode )
int WinEDA_BasePcbFrame::Test_1_Net_Ratsnest( wxDC* DC, int ref_netcode ) int WinEDA_BasePcbFrame::Test_1_Net_Ratsnest( wxDC* DC, int ref_netcode )
/**************************************************************************/ /**************************************************************************/
/** /** function Test_1_Net_Ratsnest
* Compute the rastnest relative to the net "net_code" * Compute the rastnest relative to the net "net_code"
* @param ref_netcode = netcode used to compute the rastnest. * @param ref_netcode = netcode used to compute the rastnest.
*/ */
...@@ -1043,23 +1043,20 @@ void WinEDA_BasePcbFrame::trace_ratsnest_module( wxDC* DC ) ...@@ -1043,23 +1043,20 @@ void WinEDA_BasePcbFrame::trace_ratsnest_module( wxDC* DC )
GRSetDrawMode( DC, GR_XOR ); GRSetDrawMode( DC, GR_XOR );
int tmpcolor = g_DesignSettings.m_RatsnestColor; int tmpcolor = g_DesignSettings.m_RatsnestColor;
wxPoint offset = -g_Offset_Module;
while( ii-- > 0 ) while( ii-- > 0 )
{ {
if( local_chevelu->m_Status & LOCAL_RATSNEST_ITEM ) if( local_chevelu->m_Status & LOCAL_RATSNEST_ITEM )
{ {
g_DesignSettings.m_RatsnestColor = YELLOW; g_DesignSettings.m_RatsnestColor = YELLOW;
local_chevelu->Draw( DrawPanel, DC, GR_XOR, offset ); local_chevelu->Draw( DrawPanel, DC, GR_XOR, g_Offset_Module );
} }
else else
{ {
g_DesignSettings.m_RatsnestColor = tmpcolor; g_DesignSettings.m_RatsnestColor = tmpcolor;
GRLine( &DrawPanel->m_ClipBox, DC, wxPoint tmp = local_chevelu->m_PadStart->m_Pos;
local_chevelu->m_PadStart->m_Pos.x + offset.x, local_chevelu->m_PadStart->m_Pos -= g_Offset_Module;
local_chevelu->m_PadStart->m_Pos.y + offset.y, local_chevelu->Draw( DrawPanel, DC, GR_XOR, wxPoint(0,0) );
local_chevelu->m_PadEnd->m_Pos.x, local_chevelu->m_PadStart->m_Pos = tmp;
local_chevelu->m_PadEnd->m_Pos.y,
0, g_DesignSettings.m_RatsnestColor );
} }
local_chevelu++; local_chevelu++;
} }
...@@ -1193,8 +1190,6 @@ void WinEDA_BasePcbFrame::trace_ratsnest_pad( wxDC* DC ) ...@@ -1193,8 +1190,6 @@ void WinEDA_BasePcbFrame::trace_ratsnest_pad( wxDC* DC )
if( ii >= g_MaxLinksShowed ) if( ii >= g_MaxLinksShowed )
break; break;
GRLine( &DrawPanel->m_ClipBox, DC, s_CursorPos.x, s_CursorPos.y, GRLine( &DrawPanel->m_ClipBox, DC, s_CursorPos, s_RatsnestMouseToPads[ii], 0, YELLOW );
s_RatsnestMouseToPads[ii].x, s_RatsnestMouseToPads[ii].y,
0, YELLOW );
} }
} }
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