Commit 3370b134 authored by charras's avatar charras

Eeschema: added GetPenSize() used in Draw and Plot functions to get the...

Eeschema: added GetPenSize() used in Draw and Plot functions to get the thickness of lines. Finished
parent c20d9b93
...@@ -14,11 +14,16 @@ ...@@ -14,11 +14,16 @@
#include "protos.h" #include "protos.h"
/* used to calculate the pen size from default value
* the actual pen size is default value * BUS_WIDTH_EXPAND
*/
#define BUS_WIDTH_EXPAND 1.4
/****************************/ /****************************/
/* class DrawBusEntryStruct */ /* class DrawBusEntryStruct */
/***************************/ /***************************/
const wxChar* NameMarqueurType[] = const wxChar* NameMarqueurType[] =
{ {
wxT( "" ), wxT( "" ),
wxT( "ERC" ), wxT( "ERC" ),
...@@ -105,7 +110,7 @@ EDA_Rect DrawBusEntryStruct::GetBoundingBox() ...@@ -105,7 +110,7 @@ EDA_Rect DrawBusEntryStruct::GetBoundingBox()
EDA_Rect box( wxPoint( m_Pos.x, m_Pos.y ), wxSize( dx, dy ) ); EDA_Rect box( wxPoint( m_Pos.x, m_Pos.y ), wxSize( dx, dy ) );
box.Normalize(); box.Normalize();
int width = (m_Width == 0) ? g_DrawDefaultLineThickness : m_Width; int width = (m_Width == 0) ? g_DrawDefaultLineThickness : m_Width;
box.Inflate( width / 2, width / 2 ); box.Inflate( width / 2, width / 2 );
return box; return box;
...@@ -115,13 +120,14 @@ EDA_Rect DrawBusEntryStruct::GetBoundingBox() ...@@ -115,13 +120,14 @@ EDA_Rect DrawBusEntryStruct::GetBoundingBox()
/** Function GetPenSize /** Function GetPenSize
* @return the size of the "pen" that be used to draw or plot this item * @return the size of the "pen" that be used to draw or plot this item
*/ */
int DrawBusEntryStruct::GetPenSize( ) int DrawBusEntryStruct::GetPenSize()
{ {
int pensize = (m_Width == 0) ? g_DrawDefaultLineThickness : m_Width; int pensize = (m_Width == 0) ? g_DrawDefaultLineThickness : m_Width;
if( m_Layer == LAYER_BUS ) // TODO: find a better way to handle bus thickness
if( m_Layer == LAYER_BUS && m_Width == 0 )
{ {
pensize = wxRound(pensize * 1.3); pensize = wxRound( g_DrawDefaultLineThickness * BUS_WIDTH_EXPAND );
pensize = MAX(pensize, 3); pensize = MAX( pensize, 3 );
} }
return pensize; return pensize;
...@@ -140,7 +146,7 @@ void DrawBusEntryStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -140,7 +146,7 @@ void DrawBusEntryStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
GRSetDrawMode( DC, DrawMode ); GRSetDrawMode( DC, DrawMode );
GRLine( &panel->m_ClipBox, DC, m_Pos.x + offset.x, m_Pos.y + offset.y, GRLine( &panel->m_ClipBox, DC, m_Pos.x + offset.x, m_Pos.y + offset.y,
m_End().x + offset.x, m_End().y + offset.y, GetPenSize( ), color ); m_End().x + offset.x, m_End().y + offset.y, GetPenSize(), color );
} }
...@@ -187,6 +193,7 @@ bool DrawJunctionStruct::Save( FILE* aFile ) const ...@@ -187,6 +193,7 @@ bool DrawJunctionStruct::Save( FILE* aFile ) const
EDA_Rect DrawJunctionStruct::GetBoundingBox() EDA_Rect DrawJunctionStruct::GetBoundingBox()
// return a bounding box // return a bounding box
{ {
int width = DRAWJUNCTION_SIZE * 2; int width = DRAWJUNCTION_SIZE * 2;
...@@ -208,7 +215,7 @@ bool DrawJunctionStruct::HitTest( const wxPoint& aPosRef ) ...@@ -208,7 +215,7 @@ bool DrawJunctionStruct::HitTest( const wxPoint& aPosRef )
wxPoint dist = aPosRef - m_Pos; wxPoint dist = aPosRef - m_Pos;
return sqrt( ( (double) ( dist.x * dist.x ) ) + return sqrt( ( (double) ( dist.x * dist.x ) ) +
( (double) ( dist.y * dist.y ) ) ) < DRAWJUNCTION_SIZE; ( (double) ( dist.y * dist.y ) ) ) < DRAWJUNCTION_SIZE;
} }
...@@ -216,11 +223,12 @@ bool DrawJunctionStruct::HitTest( const wxPoint& aPosRef ) ...@@ -216,11 +223,12 @@ bool DrawJunctionStruct::HitTest( const wxPoint& aPosRef )
* @return the size of the "pen" that be used to draw or plot this item * @return the size of the "pen" that be used to draw or plot this item
* has no meaning for DrawJunctionStruct * has no meaning for DrawJunctionStruct
*/ */
int DrawJunctionStruct::GetPenSize( ) int DrawJunctionStruct::GetPenSize()
{ {
return 0; return 0;
} }
/***************************************************************************** /*****************************************************************************
* Routine to redraw connection struct. * * Routine to redraw connection struct. *
*****************************************************************************/ *****************************************************************************/
...@@ -247,9 +255,10 @@ void DrawJunctionStruct::Show( int nestLevel, std::ostream& os ) ...@@ -247,9 +255,10 @@ void DrawJunctionStruct::Show( int nestLevel, std::ostream& os )
wxString s = GetClass(); wxString s = GetClass();
NestedSpace( nestLevel, os ) << '<' << s.Lower().mb_str() NestedSpace( nestLevel, os ) << '<' << s.Lower().mb_str()
<< m_Pos << "/>\n"; << m_Pos << "/>\n";
} }
#endif #endif
...@@ -278,7 +287,7 @@ EDA_Rect DrawNoConnectStruct::GetBoundingBox() ...@@ -278,7 +287,7 @@ EDA_Rect DrawNoConnectStruct::GetBoundingBox()
{ {
const int DELTA = DRAWNOCONNECT_SIZE / 2; const int DELTA = DRAWNOCONNECT_SIZE / 2;
EDA_Rect box( wxPoint( m_Pos.x - DELTA, m_Pos.y - DELTA ), EDA_Rect box( wxPoint( m_Pos.x - DELTA, m_Pos.y - DELTA ),
wxSize( 2 * DELTA, 2 * DELTA ) ); wxSize( 2 * DELTA, 2 * DELTA ) );
box.Normalize(); box.Normalize();
return box; return box;
...@@ -292,11 +301,12 @@ EDA_Rect DrawNoConnectStruct::GetBoundingBox() ...@@ -292,11 +301,12 @@ EDA_Rect DrawNoConnectStruct::GetBoundingBox()
*/ */
bool DrawNoConnectStruct::HitTest( const wxPoint& aPosRef ) bool DrawNoConnectStruct::HitTest( const wxPoint& aPosRef )
{ {
int width = g_DrawDefaultLineThickness; int width = g_DrawDefaultLineThickness;
int delta = ( DRAWNOCONNECT_SIZE + width) / 2; int delta = ( DRAWNOCONNECT_SIZE + width) / 2;
wxPoint dist = aPosRef - m_Pos; wxPoint dist = aPosRef - m_Pos;
if( (ABS(dist.x) <= delta) && (ABS(dist.y) <= delta) )
if( (ABS( dist.x ) <= delta) && (ABS( dist.y ) <= delta) )
return true; return true;
return false; return false;
} }
...@@ -324,11 +334,12 @@ bool DrawNoConnectStruct::Save( FILE* aFile ) const ...@@ -324,11 +334,12 @@ bool DrawNoConnectStruct::Save( FILE* aFile ) const
/** Function GetPenSize /** Function GetPenSize
* @return the size of the "pen" that be used to draw or plot this item * @return the size of the "pen" that be used to draw or plot this item
*/ */
int DrawNoConnectStruct::GetPenSize( ) int DrawNoConnectStruct::GetPenSize()
{ {
return g_DrawDefaultLineThickness; return g_DrawDefaultLineThickness;
} }
void DrawNoConnectStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, void DrawNoConnectStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
const wxPoint& offset, int DrawMode, int Color ) const wxPoint& offset, int DrawMode, int Color )
{ {
...@@ -357,20 +368,20 @@ void DrawNoConnectStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -357,20 +368,20 @@ void DrawNoConnectStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
char marq_bitmap[] = char marq_bitmap[] =
{ {
12, 12, 0, 0, /* Dimensions x et y, offsets x et y du bitmap de marqueurs*/ 12, 12, 0, 0, /* Dimensions x et y, offsets x et y du bitmap de marqueurs*/
YELLOW, /* Couleur */ YELLOW, /* Couleur */
1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, /* bitmap: >= 1 : color, */ 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, /* bitmap: >= 1 : color, */
1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, /* 0 = notrace */ 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, /* 0 = notrace */
1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0,
1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0,
1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0,
1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0,
1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0
}; };
char marqERC_bitmap[] = char marqERC_bitmap[] =
...@@ -391,8 +402,8 @@ char marqERC_bitmap[] = ...@@ -391,8 +402,8 @@ char marqERC_bitmap[] =
DrawMarkerStruct::DrawMarkerStruct( const wxPoint& pos, const wxString& text ) : DrawMarkerStruct::DrawMarkerStruct( const wxPoint& pos, const wxString& text ) :
SCH_ITEM( NULL, DRAW_MARKER_STRUCT_TYPE ) SCH_ITEM( NULL, DRAW_MARKER_STRUCT_TYPE )
{ {
m_Pos = pos; /* XY coordinates of marker. */ m_Pos = pos; /* XY coordinates of marker. */
m_Type = MARQ_UNSPEC; m_Type = MARQ_UNSPEC;
m_MarkFlags = 0; // complements d'information m_MarkFlags = 0; // complements d'information
m_Comment = text; m_Comment = text;
} }
...@@ -407,7 +418,7 @@ DrawMarkerStruct* DrawMarkerStruct::GenCopy() ...@@ -407,7 +418,7 @@ DrawMarkerStruct* DrawMarkerStruct::GenCopy()
{ {
DrawMarkerStruct* newitem = new DrawMarkerStruct( m_Pos, m_Comment ); DrawMarkerStruct* newitem = new DrawMarkerStruct( m_Pos, m_Comment );
newitem->m_Type = m_Type; newitem->m_Type = m_Type;
newitem->m_MarkFlags = m_MarkFlags; newitem->m_MarkFlags = m_MarkFlags;
return newitem; return newitem;
...@@ -420,7 +431,7 @@ wxString DrawMarkerStruct::GetComment() ...@@ -420,7 +431,7 @@ wxString DrawMarkerStruct::GetComment()
} }
#if defined (DEBUG) #if defined(DEBUG)
/** /**
* Function Show * Function Show
...@@ -435,6 +446,8 @@ void DrawMarkerStruct::Show( int nestLevel, std::ostream& os ) ...@@ -435,6 +446,8 @@ void DrawMarkerStruct::Show( int nestLevel, std::ostream& os )
NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() << m_Pos NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() << m_Pos
<< "/>\n"; << "/>\n";
} }
#endif #endif
/** /**
...@@ -448,7 +461,7 @@ bool DrawMarkerStruct::Save( FILE* aFile ) const ...@@ -448,7 +461,7 @@ bool DrawMarkerStruct::Save( FILE* aFile ) const
bool success = true; bool success = true;
if( fprintf( aFile, "Kmarq %c %-4d %-4d \"%s\" F=%X\n", if( fprintf( aFile, "Kmarq %c %-4d %-4d \"%s\" F=%X\n",
int( m_Type ) + 'A', m_Pos.x, m_Pos.y, int(m_Type) + 'A', m_Pos.x, m_Pos.y,
CONV_TO_UTF8( m_Comment ), m_MarkFlags ) == EOF ) CONV_TO_UTF8( m_Comment ), m_MarkFlags ) == EOF )
{ {
success = false; success = false;
...@@ -469,8 +482,8 @@ void DrawMarkerStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -469,8 +482,8 @@ void DrawMarkerStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
if( Color <= 0 ) if( Color <= 0 )
{ {
color = (m_MarkFlags == WAR ) ? color = (m_MarkFlags == WAR ) ?
g_LayerDescr.LayerColor[LAYER_ERC_WARN] : g_LayerDescr.LayerColor[LAYER_ERC_WARN] :
g_LayerDescr.LayerColor[LAYER_ERC_ERR]; g_LayerDescr.LayerColor[LAYER_ERC_ERR];
} }
Draw_Marqueur( panel, DC, m_Pos + offset, marqERC_bitmap, DrawMode, Draw_Marqueur( panel, DC, m_Pos + offset, marqERC_bitmap, DrawMode,
...@@ -530,7 +543,7 @@ bool EDA_DrawLineStruct::IsOneEndPointAt( const wxPoint& pos ) ...@@ -530,7 +543,7 @@ bool EDA_DrawLineStruct::IsOneEndPointAt( const wxPoint& pos )
} }
#if defined (DEBUG) #if defined(DEBUG)
/** /**
* Function Show * Function Show
...@@ -551,6 +564,7 @@ void EDA_DrawLineStruct::Show( int nestLevel, std::ostream& os ) ...@@ -551,6 +564,7 @@ void EDA_DrawLineStruct::Show( int nestLevel, std::ostream& os )
"</" << GetClass().Lower().mb_str() << ">\n"; "</" << GetClass().Lower().mb_str() << ">\n";
} }
#endif #endif
...@@ -566,7 +580,7 @@ EDA_Rect EDA_DrawLineStruct::GetBoundingBox() ...@@ -566,7 +580,7 @@ EDA_Rect EDA_DrawLineStruct::GetBoundingBox()
// return a rectangle which is [pos,dim) in nature. therefore the +1 // return a rectangle which is [pos,dim) in nature. therefore the +1
EDA_Rect ret( wxPoint( xmin, ymin ), EDA_Rect ret( wxPoint( xmin, ymin ),
wxSize( xmax - xmin + 1, ymax - ymin + 1 ) ); wxSize( xmax - xmin + 1, ymax - ymin + 1 ) );
return ret; return ret;
} }
...@@ -593,8 +607,8 @@ bool EDA_DrawLineStruct::Save( FILE* aFile ) const ...@@ -593,8 +607,8 @@ bool EDA_DrawLineStruct::Save( FILE* aFile ) const
{ {
success = false; success = false;
} }
if ( fprintf( aFile, "\t%-4d %-4d %-4d %-4d\n", m_Start.x,m_Start.y, if( fprintf( aFile, "\t%-4d %-4d %-4d %-4d\n", m_Start.x, m_Start.y,
m_End.x,m_End.y ) == EOF ) m_End.x, m_End.y ) == EOF )
{ {
success = false; success = false;
} }
...@@ -606,17 +620,25 @@ bool EDA_DrawLineStruct::Save( FILE* aFile ) const ...@@ -606,17 +620,25 @@ bool EDA_DrawLineStruct::Save( FILE* aFile ) const
/** Function GetPenSize /** Function GetPenSize
* @return the size of the "pen" that be used to draw or plot this item * @return the size of the "pen" that be used to draw or plot this item
*/ */
int EDA_DrawLineStruct::GetPenSize( ) int EDA_DrawLineStruct::GetPenSize()
{ {
int pensize = (m_Width == 0) ? g_DrawDefaultLineThickness : m_Width; int pensize = (m_Width == 0) ? g_DrawDefaultLineThickness : m_Width;
if( m_Layer == LAYER_BUS && m_Width == 0 )
{
pensize = wxRound( g_DrawDefaultLineThickness * BUS_WIDTH_EXPAND );
pensize = MAX( pensize, 3 );
}
return pensize; return pensize;
} }
void EDA_DrawLineStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, void EDA_DrawLineStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
const wxPoint& offset, int DrawMode, int Color ) const wxPoint& offset, int DrawMode, int Color )
{ {
int color; int color;
int width = GetPenSize( ); int width = GetPenSize();
if( Color >= 0 ) if( Color >= 0 )
color = Color; color = Color;
...@@ -625,13 +647,6 @@ void EDA_DrawLineStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -625,13 +647,6 @@ void EDA_DrawLineStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
GRSetDrawMode( DC, DrawMode ); GRSetDrawMode( DC, DrawMode );
// FIXME: Not compatable with new zoom.
if( m_Layer == LAYER_BUS)
{
width = wxRound(width * 1.4);
width = MAX(width, 3);
}
if( m_Layer == LAYER_NOTES ) if( m_Layer == LAYER_NOTES )
GRDashedLine( &panel->m_ClipBox, DC, m_Start.x + offset.x, GRDashedLine( &panel->m_ClipBox, DC, m_Start.x + offset.x,
m_Start.y + offset.y, m_End.x + offset.x, m_Start.y + offset.y, m_End.x + offset.x,
...@@ -656,7 +671,7 @@ void EDA_DrawLineStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -656,7 +671,7 @@ void EDA_DrawLineStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
DrawPolylineStruct::DrawPolylineStruct( int layer ) : DrawPolylineStruct::DrawPolylineStruct( int layer ) :
SCH_ITEM( NULL, DRAW_POLYLINE_STRUCT_TYPE ) SCH_ITEM( NULL, DRAW_POLYLINE_STRUCT_TYPE )
{ {
m_Width = 0; m_Width = 0;
switch( layer ) switch( layer )
{ {
...@@ -681,6 +696,7 @@ DrawPolylineStruct::~DrawPolylineStruct() ...@@ -681,6 +696,7 @@ DrawPolylineStruct::~DrawPolylineStruct()
DrawPolylineStruct* DrawPolylineStruct::GenCopy() DrawPolylineStruct* DrawPolylineStruct::GenCopy()
{ {
DrawPolylineStruct* newitem = new DrawPolylineStruct( m_Layer ); DrawPolylineStruct* newitem = new DrawPolylineStruct( m_Layer );
newitem->m_PolyPoints = m_PolyPoints; // std::vector copy newitem->m_PolyPoints = m_PolyPoints; // std::vector copy
return newitem; return newitem;
} }
...@@ -704,7 +720,7 @@ bool DrawPolylineStruct::Save( FILE* aFile ) const ...@@ -704,7 +720,7 @@ bool DrawPolylineStruct::Save( FILE* aFile ) const
if( GetLayer() == LAYER_BUS ) if( GetLayer() == LAYER_BUS )
layer = "Bus"; layer = "Bus";
if( fprintf( aFile, "Poly %s %s %d\n", if( fprintf( aFile, "Poly %s %s %d\n",
width, layer, GetCornerCount() ) == EOF ) width, layer, GetCornerCount() ) == EOF )
{ {
return false; return false;
} }
...@@ -725,17 +741,19 @@ bool DrawPolylineStruct::Save( FILE* aFile ) const ...@@ -725,17 +741,19 @@ bool DrawPolylineStruct::Save( FILE* aFile ) const
/** Function GetPenSize /** Function GetPenSize
* @return the size of the "pen" that be used to draw or plot this item * @return the size of the "pen" that be used to draw or plot this item
*/ */
int DrawPolylineStruct::GetPenSize( ) int DrawPolylineStruct::GetPenSize()
{ {
int pensize = (m_Width == 0) ? g_DrawDefaultLineThickness : m_Width; int pensize = (m_Width == 0) ? g_DrawDefaultLineThickness : m_Width;
return pensize; return pensize;
} }
void DrawPolylineStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, void DrawPolylineStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
const wxPoint& offset, int DrawMode, int Color ) const wxPoint& offset, int DrawMode, int Color )
{ {
int color; int color;
int width = GetPenSize( ); int width = GetPenSize();
if( Color >= 0 ) if( Color >= 0 )
color = Color; color = Color;
......
...@@ -38,7 +38,7 @@ static void PlotNoConnectStruct( Plotter* plotter, DrawNoConnectStruct* Struct ) ...@@ -38,7 +38,7 @@ static void PlotNoConnectStruct( Plotter* plotter, DrawNoConnectStruct* Struct )
pX = Struct->m_Pos.x; pY = Struct->m_Pos.y; pX = Struct->m_Pos.x; pY = Struct->m_Pos.y;
plotter->set_current_line_width( Struct->GetPenSize( ) ); plotter->set_current_line_width( Struct->GetPenSize() );
plotter->move_to( wxPoint( pX - DELTA, pY - DELTA ) ); plotter->move_to( wxPoint( pX - DELTA, pY - DELTA ) );
plotter->finish_to( wxPoint( pX + DELTA, pY + DELTA ) ); plotter->finish_to( wxPoint( pX + DELTA, pY + DELTA ) );
plotter->move_to( wxPoint( pX + DELTA, pY - DELTA ) ); plotter->move_to( wxPoint( pX + DELTA, pY - DELTA ) );
...@@ -74,7 +74,7 @@ static void PlotLibPart( Plotter* plotter, SCH_COMPONENT* DrawLibItem ) ...@@ -74,7 +74,7 @@ static void PlotLibPart( Plotter* plotter, SCH_COMPONENT* DrawLibItem )
if( convert && DEntry->m_Convert && (DEntry->m_Convert != convert) ) if( convert && DEntry->m_Convert && (DEntry->m_Convert != convert) )
continue; continue;
int thickness = DEntry->GetPenSize( ); int thickness = DEntry->GetPenSize();
plotter->set_color( ReturnLayerColor( LAYER_DEVICE ) ); plotter->set_color( ReturnLayerColor( LAYER_DEVICE ) );
draw_bgfill = plotter->get_color_mode(); draw_bgfill = plotter->get_color_mode();
...@@ -367,7 +367,7 @@ static void PlotTextField( Plotter* plotter, SCH_COMPONENT* DrawLibItem, ...@@ -367,7 +367,7 @@ static void PlotTextField( Plotter* plotter, SCH_COMPONENT* DrawLibItem,
} }
int thickness = field->GetPenSize( ); int thickness = field->GetPenSize();
if( !IsMulti || (FieldNumber != REFERENCE) ) if( !IsMulti || (FieldNumber != REFERENCE) )
{ {
...@@ -504,7 +504,7 @@ static void PlotPinSymbol( Plotter* plotter, const wxPoint& pos, ...@@ -504,7 +504,7 @@ static void PlotPinSymbol( Plotter* plotter, const wxPoint& pos,
/********************************************************************/ /********************************************************************/
static void PlotTextStruct( Plotter* plotter, SCH_TEXT* aSchText ) static void PlotTextStruct( Plotter* plotter, SCH_TEXT* aSchText )
/********************************************************************/ /********************************************************************/
/* /*
...@@ -526,10 +526,10 @@ static void PlotTextStruct( Plotter* plotter, SCH_TEXT* aSchText ) ...@@ -526,10 +526,10 @@ static void PlotTextStruct( Plotter* plotter, SCH_TEXT* aSchText )
return; return;
} }
EDA_Colors color = UNSPECIFIED_COLOR; EDA_Colors color = UNSPECIFIED_COLOR;
color = ReturnLayerColor( aSchText->m_Layer ); color = ReturnLayerColor( aSchText->m_Layer );
wxPoint textpos = aSchText->m_Pos + aSchText->GetSchematicTextOffset(); wxPoint textpos = aSchText->m_Pos + aSchText->GetSchematicTextOffset();
int thickness = aSchText->GetPenSize( ); int thickness = aSchText->GetPenSize();
plotter->set_current_line_width( thickness ); plotter->set_current_line_width( thickness );
...@@ -604,7 +604,7 @@ static void Plot_Hierarchical_PIN_Sheet( Plotter* plotter, ...@@ -604,7 +604,7 @@ static void Plot_Hierarchical_PIN_Sheet( Plotter* plotter,
side = GR_TEXT_HJUSTIFY_LEFT; side = GR_TEXT_HJUSTIFY_LEFT;
} }
int thickness = aHierarchical_PIN->GetPenSize( ); int thickness = aHierarchical_PIN->GetPenSize();
plotter->set_current_line_width( thickness ); plotter->set_current_line_width( thickness );
plotter->text( wxPoint( tposx, posy ), txtcolor, plotter->text( wxPoint( tposx, posy ), txtcolor,
...@@ -632,7 +632,7 @@ static void PlotSheetStruct( Plotter* plotter, DrawSheetStruct* Struct ) ...@@ -632,7 +632,7 @@ static void PlotSheetStruct( Plotter* plotter, DrawSheetStruct* Struct )
plotter->set_color( ReturnLayerColor( Struct->m_Layer ) ); plotter->set_color( ReturnLayerColor( Struct->m_Layer ) );
int thickness = Struct->GetPenSize( ); int thickness = Struct->GetPenSize();
plotter->set_current_line_width( thickness ); plotter->set_current_line_width( thickness );
plotter->move_to( Struct->m_Pos ); plotter->move_to( Struct->m_Pos );
...@@ -698,10 +698,10 @@ void PlotDrawlist( Plotter* plotter, SCH_ITEM* aDrawlist ) ...@@ -698,10 +698,10 @@ void PlotDrawlist( Plotter* plotter, SCH_ITEM* aDrawlist )
int layer; int layer;
wxPoint StartPos, EndPos; wxPoint StartPos, EndPos;
plotter->set_current_line_width( aDrawlist->GetPenSize( ) ); plotter->set_current_line_width( aDrawlist->GetPenSize() );
switch( aDrawlist->Type() ) switch( aDrawlist->Type() )
{ {
case DRAW_BUSENTRY_STRUCT_TYPE: /* Struct Raccord et Segment sont identiques */ case DRAW_BUSENTRY_STRUCT_TYPE:
case DRAW_SEGMENT_STRUCT_TYPE: case DRAW_SEGMENT_STRUCT_TYPE:
if( aDrawlist->Type() == DRAW_BUSENTRY_STRUCT_TYPE ) if( aDrawlist->Type() == DRAW_BUSENTRY_STRUCT_TYPE )
{ {
...@@ -722,24 +722,12 @@ void PlotDrawlist( Plotter* plotter, SCH_ITEM* aDrawlist ) ...@@ -722,24 +722,12 @@ void PlotDrawlist( Plotter* plotter, SCH_ITEM* aDrawlist )
plotter->set_color( ReturnLayerColor( layer ) ); plotter->set_color( ReturnLayerColor( layer ) );
} }
switch( layer ) if( layer == LAYER_NOTES )
{
case LAYER_NOTES: /* Trace en pointilles */
plotter->set_dash( true ); plotter->set_dash( true );
plotter->move_to( StartPos ); plotter->move_to( StartPos );
plotter->finish_to( EndPos ); plotter->finish_to( EndPos );
if( layer == LAYER_NOTES )
plotter->set_dash( false ); plotter->set_dash( false );
break;
case LAYER_BUS: /* Trait large */
plotter->thick_segment( StartPos, EndPos, aDrawlist->GetPenSize( ), FILLED );
break;
default:
plotter->move_to( StartPos );
plotter->finish_to( EndPos );
break;
}
break; break;
...@@ -747,7 +735,7 @@ void PlotDrawlist( Plotter* plotter, SCH_ITEM* aDrawlist ) ...@@ -747,7 +735,7 @@ void PlotDrawlist( Plotter* plotter, SCH_ITEM* aDrawlist )
#undef STRUCT #undef STRUCT
#define STRUCT ( (DrawJunctionStruct*) aDrawlist ) #define STRUCT ( (DrawJunctionStruct*) aDrawlist )
plotter->set_color( ReturnLayerColor( STRUCT->GetLayer() ) ); plotter->set_color( ReturnLayerColor( STRUCT->GetLayer() ) );
plotter->circle( STRUCT->m_Pos, DRAWJUNCTION_SIZE*2, FILLED_SHAPE ); plotter->circle( STRUCT->m_Pos, DRAWJUNCTION_SIZE * 2, FILLED_SHAPE );
break; break;
case TYPE_SCH_TEXT: case TYPE_SCH_TEXT:
......
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