← Back to team overview

kicad-developers team mailing list archive

Bugfix for plotting

 

This fixes the reported issues.

A note about the coding style: the * attached to the type name is deceptive: C is not Pascal, the pointer modifiers apply only to the first element!

Index: plotdxf.cpp
===================================================================
--- plotdxf.cpp (revision 154)
+++ plotdxf.cpp (working copy)
@@ -291,7 +291,7 @@
SCH_SCREEN* oldscreen = screen;
DrawSheetPath* sheetpath, *oldsheetpath = schframe->GetSheet();
wxString PlotFileName;
- Ki_PageDescr* PlotSheet, *RealSheet;
+ Ki_PageDescr *PlotSheet;
wxPoint plot_offset;

/* When printing all pages, the printed page is not the current page.
@@ -330,7 +330,7 @@

PlotFileName = schframe->GetUniqueFilenameForCurrentSheet( ) + wxT( ".dxf" );

- PlotOneSheetDXF( PlotFileName, screen, RealSheet, plot_offset, scale );
+ PlotOneSheetDXF( PlotFileName, screen, PlotSheet, plot_offset, scale );

if( !AllPages )
break;
Index: plot.cpp
===================================================================
--- plot.cpp (revision 154)
+++ plot.cpp (working copy)
@@ -88,12 +88,12 @@
if( draw_bgfill && Arc->m_Fill == FILLED_WITH_BG_BODYCOLOR)
{
plotter->set_color( ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
- plotter->arc( pos, t1, t2, Arc->m_Rayon, FILLED_SHAPE, 0 );
+ plotter->arc( pos, -t2, -t1, Arc->m_Rayon, FILLED_SHAPE, 0);
}
plotter->set_color( ReturnLayerColor( LAYER_DEVICE ) );
plotter->arc( pos,
- t1,
- t2,
+ -t2,
+ -t1,
Arc->m_Rayon,
Arc->m_Fill,
Arc->m_Width );
@@ -712,19 +712,24 @@
switch( drawlist->Type() )
{
case DRAW_BUSENTRY_STRUCT_TYPE: /* Struct Raccord et Segment sont iden$
- #undef STRUCT
- #define STRUCT ( (DrawBusEntryStruct*) drawlist )
- StartPos = STRUCT->m_Pos;
- EndPos = STRUCT->m_End();
- layer = STRUCT->GetLayer();
-
case DRAW_SEGMENT_STRUCT_TYPE:
- #undef STRUCT
- #define STRUCT ( (EDA_DrawLineStruct*) drawlist )
- StartPos = STRUCT->m_Start;
- EndPos = STRUCT->m_End;
- layer = STRUCT->GetLayer();
- plotter->set_color( ReturnLayerColor( layer ) );
+ if( drawlist->Type() == DRAW_BUSENTRY_STRUCT_TYPE )
+ {
+#undef STRUCT
+#define STRUCT ( (DrawBusEntryStruct*) drawlist )
+ StartPos = STRUCT->m_Pos;
+ EndPos = STRUCT->m_End();
+ layer = STRUCT->GetLayer();
+ }
+ else
+ {
+#undef STRUCT
+#define STRUCT ( (EDA_DrawLineStruct*) drawlist )
+ StartPos = STRUCT->m_Start;
+ EndPos = STRUCT->m_End;
+ layer = STRUCT->GetLayer();
+ plotter->set_color( ReturnLayerColor( layer ) );
+ }

switch( layer )
{







Follow ups