← Back to team overview

kicad-developers team mailing list archive

Re: Re: Bugs 2003834 and 1956732

 

Jean-Pierre,

Attached is a better patch. I found some more discrepancies.

These are all in HEAD already. This patch is INSTEAD of the other one, 
not in addition to it, should you want to apply it to the new TAG branch.

Dick

 --------------070507080905030504040006 Content-Type: text/x-diff;
name="plot_fill.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="plot_fill.patch"

Index: eeschema/libcmp.h
===================================================================
--- eeschema/libcmp.h	(revision 1178)
+++ eeschema/libcmp.h	(working copy)
@@ -238,7 +238,7 @@
{
public:
int m_Rayon;
- int m_Fill;
+ bool m_Fill;
int t1, t2; /* position des 2 extremites de l'arc en 0,1 degres */
wxPoint m_ArcStart, m_ArcEnd; /* position des 2 extremites de l'arc en coord reelles*/

@@ -258,8 +258,8 @@
class LibDrawCircle : public LibEDA_BaseStruct
{
public:
- int m_Rayon;
- int m_Fill;
+ int m_Rayon;
+ bool m_Fill;

public:
LibDrawCircle();
@@ -299,7 +299,7 @@
{
public:
wxPoint m_End;
- int m_Fill;
+ bool m_Fill;

public:
LibDrawSquare();
@@ -335,8 +335,9 @@
class LibDrawPolyline : public LibEDA_BaseStruct
{
public:
- int n, * PolyList;
- int m_Fill;
+ int n;
+ int* PolyList;
+ bool m_Fill;

public:
LibDrawPolyline();
Index: eeschema/plothpgl.cpp
===================================================================
--- eeschema/plothpgl.cpp	(revision 1178)
+++ eeschema/plothpgl.cpp	(working copy)
@@ -677,7 +677,7 @@
#undef STRUCT
#define STRUCT ( (DrawJunctionStruct*) DrawList )
x1 = STRUCT->m_Pos.x; y1 = STRUCT->m_Pos.y;
- PlotCercle( wxPoint( x1, y1 ), DRAWJUNCTION_SIZE * 2, 1 );
+ PlotCercle( wxPoint( x1, y1 ), true, DRAWJUNCTION_SIZE * 2 );
break;

case TYPE_SCH_TEXT:
Index: eeschema/protos.h
===================================================================
--- eeschema/protos.h	(revision 1178)
+++ eeschema/protos.h	(working copy)
@@ -290,8 +290,8 @@
void SetCurrentLineWidth( int width);

void PlotArc(wxPoint centre, int StAngle, int EndAngle, int rayon, int width = -1);
-void PlotCercle(wxPoint centre, int diametre, int fill, int width = -1);
-void PlotPoly( int nb, int * coord, int fill, int width = -1);
+void PlotCercle(wxPoint centre, int diametre, bool fill, int width = -1);
+void PlotPoly( int nb, int * coord, bool fill, int width = -1);

void PlotNoConnectStruct(DrawNoConnectStruct * Struct);
void PlotLibPart( SCH_COMPONENT *DrawLibItem );
Index: eeschema/plot.cpp
===================================================================
--- eeschema/plot.cpp	(revision 1178)
+++ eeschema/plot.cpp	(working copy)
@@ -23,8 +23,8 @@
/***/

/* cte pour remplissage de polygones */
-#define FILL 1
-#define NOFILL 0
+#define FILL true
+#define NOFILL false

#define PLOT_SHEETREF_MARGIN 0 // margin for sheet refs

@@ -90,7 +90,7 @@
}

/*******************************************************************************/
-void PlotArc( wxPoint centre, int StAngle, int EndAngle, int rayon, int fill, int width )
+void PlotArc( wxPoint centre, int StAngle, int EndAngle, int rayon, bool fill, int width )
/*******************************************************************************/

/* trace d'un arc de cercle:
@@ -113,7 +113,7 @@


/*******************************************************/
-void PlotCercle( wxPoint pos, int diametre, int fill, int width )
+void PlotCercle( wxPoint pos, int diametre, bool fill, int width )
/*******************************************************/
{
switch( g_PlotFormat )
@@ -130,7 +130,7 @@


/******************************************************************/
-void PlotPoly( int nb, int* coord, int fill, int width )
+void PlotPoly( int nb, int* coord, bool fill, int width )
/******************************************************************/

/* Trace un polygone ferme
@@ -480,7 +480,7 @@
{
PlotCercle( wxPoint( MapX1 * INVERT_PIN_RADIUS + x1,
MapY1 * INVERT_PIN_RADIUS + y1),
- INVERT_PIN_RADIUS * 2,0 );
+ false, INVERT_PIN_RADIUS * 2 );

Move_Plume( wxPoint( MapX1 * INVERT_PIN_RADIUS * 2 + x1,
MapY1 * INVERT_PIN_RADIUS * 2 + y1 ), 'U' );
Index: pcbnew/specctra.h
===================================================================
--- pcbnew/specctra.h	(revision 1178)
+++ pcbnew/specctra.h	(working copy)
@@ -2631,19 +2631,25 @@
void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError )
{
const char* quote = out->GetQuoteChar( net_id.c_str() );
+ const char* space = " ";

- out->Print( nestLevel, "(%s %s%s%s ", LEXER::GetTokenText( Type() ),
+ out->Print( nestLevel, "(%s %s%s%s", LEXER::GetTokenText( Type() ),
quote, net_id.c_str(), quote );

if( unassigned )
- out->Print( 0, "(unassigned)" );
+ {
+ out->Print( 0, "%s(unassigned)", space );
+ space = ""; // only needed one space
+ }

if( net_number != T_NONE )
- out->Print( 0, "(net_number %d)", net_number );
+ {
+ out->Print( 0, "%s(net_number %d)", space, net_number );
+ // space = "";
+ }

out->Print( 0, "\n" );

-
const int RIGHTMARGIN = 80;
int perLine = out->Print( nestLevel+1, "(%s", LEXER::GetTokenText( pins_type ) );

Index: pcbnew/plot_rtn.cpp
===================================================================
--- pcbnew/plot_rtn.cpp	(revision 1178)
+++ pcbnew/plot_rtn.cpp	(working copy)
@@ -791,7 +791,7 @@
break;

case PLOT_FORMAT_POST:
- PlotCirclePS( centre, radius * 2, thickness, 0);
+ PlotCirclePS( centre, radius * 2, 0, thickness);
break;
}
}
Index: include/plot_common.h
===================================================================
--- include/plot_common.h	(revision 1178)
+++ include/plot_common.h	(working copy)
@@ -1,5 +1,5 @@
/********************/
-/*	plot_common.h	*/
+/* plot_common.h */
/********************/

#ifndef PLOT_COMMON_H
@@ -61,12 +61,12 @@
double yscale,
int orient = 0 );
void SetDefaultLineWidthPS( int width );
-void	PlotRectPS(wxPoint p1, wxPoint p2, int fill, int width = -1);
-void PlotCirclePS( wxPoint pos, int diametre, int fill, int width = -1 );
-void PlotArcPS( wxPoint centre, int StAngle, int EndAngle, int rayon, int fill, int width = -1 );
+void PlotRectPS( wxPoint p1, wxPoint p2, bool fill, int width = -1 );
+void PlotCirclePS( wxPoint pos, int diametre, bool fill, int width = -1 );
+void PlotArcPS( wxPoint centre, int StAngle, int EndAngle, int rayon, bool fill, int width = -1 );

// Plot an arc: StAngle, EndAngle = start and end arc in 0.1 degree
-void PlotPolyPS( int nb_segm, int* coord, int fill, int width = -1 );
+void PlotPolyPS( int nb_segm, int* coord, bool fill, int width = -1 );
void PlotFilledSegmentPS( wxPoint start, wxPoint end, int width );
void LineTo_PS( wxPoint pos, int plume );
void PrintHeaderPS( FILE* file,
@@ -85,10 +85,10 @@
void InitPlotParametresHPGL( wxPoint offset, double xscale, double yscale, int orient = 0 );
bool PrintHeaderHPGL( FILE* plot_file, int pen_speed, int pen_num );
bool CloseFileHPGL( FILE* plot_file );
-void PlotCircleHPGL( wxPoint centre, int diameter, int fill, int width = -1 );
-void	PlotRectHPGL(wxPoint t1, wxPoint t2, int fill, int width = -1);
-void PlotArcHPGL( wxPoint centre, int StAngle, int EndAngle, int rayon, int fill, int width = -1 );
-void PlotPolyHPGL( int nb, int* coord, int fill, int width = -1 );
+void PlotCircleHPGL( wxPoint centre, int diameter, bool fill, int width = -1 );
+void PlotRectHPGL( wxPoint t1, wxPoint t2, bool fill, int width = -1 );
+void PlotArcHPGL( wxPoint centre, int StAngle, int EndAngle, int rayon, bool fill, int width = -1 );
+void PlotPolyHPGL( int nb, int* coord, bool fill, int width = -1 );
void Move_Plume_HPGL( wxPoint pos, int plume );
void Plume_HPGL( int plume );

Index: common/common_plotPS_functions.cpp
===================================================================
--- common/common_plotPS_functions.cpp	(revision 1178)
+++ common/common_plotPS_functions.cpp	(working copy)
@@ -114,19 +114,19 @@
}

/***************************************************************/
-void PlotRectPS( wxPoint p1, wxPoint p2, int fill, int width )
+void PlotRectPS( wxPoint p1, wxPoint p2, bool fill, int width )
/***************************************************************/
{
UserToDeviceCoordinate( p1 );
UserToDeviceCoordinate( p2 );

SetCurrentLineWidthPS( width );
- fprintf( PlotOutputFile, "%d %d %d %d rect%d\n", p1.x, p1.y, 
-	p2.x-p1.x, p2.y-p1.y, fill );
+ fprintf( PlotOutputFile, "%d %d %d %d rect%d\n", p1.x, p1.y,
+ p2.x-p1.x, p2.y-p1.y, fill );
}

/******************************************************/
-void PlotCirclePS( wxPoint pos, int diametre, int fill, int width )
+void PlotCirclePS( wxPoint pos, int diametre, bool fill, int width )
/******************************************************/
{
int rayon;
@@ -145,7 +145,7 @@


/**************************************************************************************/
-void PlotArcPS( wxPoint centre, int StAngle, int EndAngle, int rayon, int fill, int width )
+void PlotArcPS( wxPoint centre, int StAngle, int EndAngle, int rayon, bool fill, int width )
/**************************************************************************************/

/* Plot an arc:
@@ -165,11 +165,11 @@
if( PlotOrientOptions == PLOT_MIROIR )
sprintf( Line, "%d %d %d %f %f arc%d\n", centre.x, centre.y,
(int) (rayon * XScale), (float) StAngle / 10, (float) EndAngle / 10,
-	fill);
+ fill);
else
sprintf( Line, "%d %d %d %f %f arc%d\n", centre.x, centre.y,
(int) (rayon * XScale), -(float) EndAngle / 10, -(float) StAngle / 10,
-	fill);
+ fill);

// Undo internationalization printf (float x.y printed x,y)
to_point( Line );
@@ -178,7 +178,7 @@


/*****************************************************************/
-void PlotPolyPS( int nb_segm, int* coord, int fill, int width )
+void PlotPolyPS( int nb_segm, int* coord, bool fill, int width )
/*****************************************************************/

/* Draw a polygon ( a filled polygon if fill == 1 ) in POSTSCRIPT format
@@ -270,18 +270,18 @@
" lineto\n",
" stroke\n",
"} bind def\n",
-	"/cir0 { newpath 0 360 arc stroke } bind def\n",
-	"/cir1 { newpath 0 360 arc gsave fill grestore stroke } bind def\n",
-	"/cir2 { newpath 0 360 arc gsave fill grestore stroke } bind def\n",
-	"/arc0 { newpath arc stroke } bind def\n",
-	"/arc1 { newpath 4 index 4 index moveto arc closepath gsave fill grestore stroke } bind def\n",
-	"/arc2 { newpath 4 index 4 index moveto arc closepath gsave fill grestore stroke } bind def\n",
-	"/poly0 { stroke } bind def\n",
-	"/poly1 { closepath gsave fill grestore stroke } bind def\n",
-	"/poly2 { closepath gsave fill grestore stroke } bind def\n",
-	"/rect0 { rectstroke } bind def\n",
-	"/rect1 { rectfill } bind def\n",
-	"/rect2 { rectfill } bind def\n",
+ "/cir0 { newpath 0 360 arc stroke } bind def\n",
+ "/cir1 { newpath 0 360 arc gsave fill grestore stroke } bind def\n",
+ "/cir2 { newpath 0 360 arc gsave fill grestore stroke } bind def\n",
+ "/arc0 { newpath arc stroke } bind def\n",
+ "/arc1 { newpath 4 index 4 index moveto arc closepath gsave fill grestore stroke } bind def\n",
+ "/arc2 { newpath 4 index 4 index moveto arc closepath gsave fill grestore stroke } bind def\n",
+ "/poly0 { stroke } bind def\n",
+ "/poly1 { closepath gsave fill grestore stroke } bind def\n",
+ "/poly2 { closepath gsave fill grestore stroke } bind def\n",
+ "/rect0 { rectstroke } bind def\n",
+ "/rect1 { rectfill } bind def\n",
+ "/rect2 { rectfill } bind def\n",
"gsave\n",
"72 72 scale\t\t\t% Talk inches\n",
"1 setlinecap\n",
Index: common/common_plotHPGL_functions.cpp
===================================================================
--- common/common_plotHPGL_functions.cpp	(revision 1178)
+++ common/common_plotHPGL_functions.cpp	(working copy)
@@ -69,7 +69,7 @@
}

/************************************************************/
-void PlotRectHPGL( wxPoint p1, wxPoint p2, int fill, int width )
+void PlotRectHPGL( wxPoint p1, wxPoint p2, bool fill, int width )
/************************************************************/
{
char Line[256];
@@ -86,7 +86,7 @@


/************************************************************/
-void PlotCircleHPGL( wxPoint centre, int diameter, int fill, int width )
+void PlotCircleHPGL( wxPoint centre, int diameter, bool fill, int width )
/************************************************************/
{
int rayon;
@@ -107,7 +107,7 @@


/********************************************************************/
-void PlotArcHPGL( wxPoint centre, int StAngle, int EndAngle, int rayon, int fill, int width )
+void PlotArcHPGL( wxPoint centre, int StAngle, int EndAngle, int rayon, bool fill, int width )
/********************************************************************/

/* trace d'un arc de cercle:
@@ -153,7 +153,7 @@


/*****************************************************/
-void PlotPolyHPGL( int nb, int* coord, int fill, int width )
+void PlotPolyHPGL( int nb, int* coord, bool fill, int width )
/*****************************************************/

/* Trace un polygone (ferme si rempli) en format HPGL
 --------------070507080905030504040006-- 




References