diff --git a/common/copy_to_clipboard.cpp b/common/copy_to_clipboard.cpp index 64d6d38ca0..695e3f1101 100644 --- a/common/copy_to_clipboard.cpp +++ b/common/copy_to_clipboard.cpp @@ -121,7 +121,7 @@ bool DrawPage( WinEDA_DrawPanel* panel ) { dc.SetClippingRegion( DrawArea ); } - panel->PrintPage( &dc, Print_Sheet_Ref, -1 ); + panel->PrintPage( &dc, Print_Sheet_Ref, -1, false ); g_IsPrinting = FALSE; panel->m_ClipBox = tmp; wxMetafile* mf = dc.Close(); diff --git a/eeschema/eeredraw.cpp b/eeschema/eeredraw.cpp index 01edb18c77..981e913490 100644 --- a/eeschema/eeredraw.cpp +++ b/eeschema/eeredraw.cpp @@ -134,15 +134,16 @@ void WinEDA_SchematicFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg ) } -/*******************************************************************************/ -void WinEDA_DrawPanel::PrintPage( wxDC* DC, bool Print_Sheet_Ref, int PrintMask ) -/*******************************************************************************/ +/******************************************************************************************************/ +void WinEDA_DrawPanel::PrintPage( wxDC* DC, bool Print_Sheet_Ref, int PrintMask, bool aPrintMirrorMode ) +/******************************************************************************************************/ /** PrintPage * used to print a page. * Print the page pointed by ActiveScreen, set by the calling print function * @param DC = wxDC given by the calling print function * @param Print_Sheet_Ref = true to print page references * @param PrintMask = not used here + * @param aPrintMirrorMode = not used here (Set when printing in mirror mode) */ { wxBeginBusyCursor(); diff --git a/gerbview/tracepcb.cpp b/gerbview/tracepcb.cpp index f743aeeabd..0c7969a35e 100644 --- a/gerbview/tracepcb.cpp +++ b/gerbview/tracepcb.cpp @@ -22,9 +22,9 @@ /* Variables Locales */ -/**********************************************************************************/ -void WinEDA_DrawPanel::PrintPage( wxDC* DC, bool Print_Sheet_Ref, int printmasklayer ) -/**********************************************************************************/ +/************************************************************************************************************/ +void WinEDA_DrawPanel::PrintPage( wxDC* DC, bool Print_Sheet_Ref, int printmasklayer, bool aPrintMirrorMode ) +/*************************************************************************************************************/ /* routine de trace du pcb, avec selection des couches */ { DISPLAY_OPTIONS save_opt; @@ -47,11 +47,15 @@ void WinEDA_DrawPanel::PrintPage( wxDC* DC, bool Print_Sheet_Ref, int printmaskl DisplayPolygonsModeImg = g_DisplayPolygonsModeSketch; g_DisplayPolygonsModeSketch = 0; + m_PrintIsMirrored = aPrintMirrorMode; + ( (WinEDA_GerberFrame*) m_Parent )->Trace_Gerber( DC, GR_COPY, printmasklayer ); if( Print_Sheet_Ref ) m_Parent->TraceWorkSheet( DC, GetScreen(), 0 ); + m_PrintIsMirrored = false; + DisplayOpt = save_opt; g_DisplayPolygonsModeSketch = DisplayPolygonsModeImg; } diff --git a/include/drawpanel_wxstruct.h b/include/drawpanel_wxstruct.h index 55824087d8..aecab6b365 100644 --- a/include/drawpanel_wxstruct.h +++ b/include/drawpanel_wxstruct.h @@ -43,6 +43,8 @@ public: bool m_Block_Enable; // TRUE to accept Block Commands int m_CanStartBlock; // >= 0 (or >= n) if a block can start + bool m_PrintIsMirrored; // True when drawing in mirror mode. Used in draw arc function, + // because arcs are oriented, and in mirror mode, orientations are reversed // usefull to avoid false start block in certain cases (like switch from a sheet to an other scheet int m_PanelDefaultCursor; // Current mouse cursor default shape id for this window int m_PanelCursor; // Current mouse cursor shape id for this window @@ -71,7 +73,7 @@ public: void OnSize( wxSizeEvent& event ); void SetBoundaryBox(); void ReDraw( wxDC* DC, bool erasebg = TRUE ); - void PrintPage( wxDC* DC, bool Print_Sheet_Ref, int PrintMask ); + void PrintPage( wxDC* DC, bool Print_Sheet_Ref, int PrintMask, bool aPrintMirrorMode ); void DrawBackGround( wxDC* DC ); void m_Draw_Auxiliary_Axis( wxDC* DC, int drawmode ); void OnEraseBackground( wxEraseEvent& event ); diff --git a/pcbnew/class_drawsegment.cpp b/pcbnew/class_drawsegment.cpp index 1356affbca..fbecdaafd2 100644 --- a/pcbnew/class_drawsegment.cpp +++ b/pcbnew/class_drawsegment.cpp @@ -244,8 +244,17 @@ void DRAWSEGMENT::Draw( WinEDA_DrawPanel* panel, wxDC* DC, StAngle = (int) ArcTangente( dy - uy0, dx - ux0 ); EndAngle = StAngle + m_Angle; - if( StAngle > EndAngle ) - EXCHG( StAngle, EndAngle ); + if ( ! panel->m_PrintIsMirrored) + { + if( StAngle > EndAngle ) + EXCHG( StAngle, EndAngle ); + } + else //Mirrored mode: arc orientation is reversed + { + if( StAngle < EndAngle ) + EXCHG( StAngle, EndAngle ); + } + if( mode == FILAIRE ) GRArc( &panel->m_ClipBox, DC, ux0, uy0, StAngle, EndAngle, rayon, color ); diff --git a/pcbnew/lay2plot.cpp b/pcbnew/lay2plot.cpp index 93b2594435..bc9081f6b0 100644 --- a/pcbnew/lay2plot.cpp +++ b/pcbnew/lay2plot.cpp @@ -19,9 +19,9 @@ static void Plot_Module( WinEDA_DrawPanel* panel, wxDC* DC, MODULE* Module, int draw_mode, int masklayer ); -/**********************************************************************************/ -void WinEDA_DrawPanel::PrintPage( wxDC* DC, bool Print_Sheet_Ref, int printmasklayer ) -/**********************************************************************************/ +/************************************************************************************************************/ +void WinEDA_DrawPanel::PrintPage( wxDC* DC, bool Print_Sheet_Ref, int printmasklayer, bool aPrintMirrorMode ) +/************************************************************************************************************/ /* Used to print the board. * Draw the board, but only layers allowed by printmasklayer @@ -51,6 +51,8 @@ void WinEDA_DrawPanel::PrintPage( wxDC* DC, bool Print_Sheet_Ref, int printmaskl DisplayOpt.DisplayDrawItems = FILLED; DisplayOpt.DisplayZones = TRUE; + m_PrintIsMirrored = aPrintMirrorMode; + /* Draw the pcb graphic items (texts, ...) */ for( BOARD_ITEM* item = Pcb->m_Drawings; item; item = item->Next() ) { @@ -138,6 +140,8 @@ void WinEDA_DrawPanel::PrintPage( wxDC* DC, bool Print_Sheet_Ref, int printmaskl if( Print_Sheet_Ref ) m_Parent->TraceWorkSheet( DC, ActiveScreen, 0 ); + m_PrintIsMirrored = false; + DisplayOpt = save_opt; frame->m_DisplayPcbTrackFill = DisplayOpt.DisplayPcbTrackFill; frame->m_DisplayPadFill = DisplayOpt.DisplayPadFill; diff --git a/pcbnew/zones_convert_brd_items_to_polygons.cpp b/pcbnew/zones_convert_brd_items_to_polygons.cpp index c1406a45f4..709a598278 100644 --- a/pcbnew/zones_convert_brd_items_to_polygons.cpp +++ b/pcbnew/zones_convert_brd_items_to_polygons.cpp @@ -36,9 +36,9 @@ void AddTextBoxWithClearancePolygon( Bool_Engine* aBooleng, static int s_CircleToSegmentsCount = 16; /* default value. the real value will be changed to 32 * if g_Zone_Arc_Approximation == 1 */ -double s_Correction; /* mult coeff used to enlarge rouded and oval pads +double s_Correction; /* mult coeff used to enlarge rounded and oval pads (and vias) * because the segment approximation for arcs and circles - * create a smaler gap than a trur circle + * create a smaller gap than a true circle */ /** function AddClearanceAreasPolygonsToPolysList * Add non copper areas polygons (pads and tracks with clearence) diff --git a/share/drawpanel.cpp b/share/drawpanel.cpp index de1f74bb24..4063bb1d83 100644 --- a/share/drawpanel.cpp +++ b/share/drawpanel.cpp @@ -87,6 +87,7 @@ WinEDA_DrawPanel::WinEDA_DrawPanel( WinEDA_DrawFrame* parent, int id, m_Block_Enable = FALSE; m_PanelDefaultCursor = m_PanelCursor = wxCURSOR_ARROW; m_CursorLevel = 0; + m_PrintIsMirrored = false; } diff --git a/share/svg_print.cpp b/share/svg_print.cpp index 957a7b37dd..4f0548b432 100644 --- a/share/svg_print.cpp +++ b/share/svg_print.cpp @@ -475,7 +475,7 @@ bool WinEDA_PrintSVGFrame::DrawPage( const wxString& FullFileName, BASE_SCREEN* g_IsPrinting = TRUE; SetLocaleTo_C_standard( ); // Switch the locale to standard C (needed to print floating point numbers like 1.3) - panel->PrintPage( &dc, m_Print_Sheet_Ref, m_PrintMaskLayer ); + panel->PrintPage( &dc, m_Print_Sheet_Ref, m_PrintMaskLayer, false ); SetLocaleTo_Default( ); // revert to the current locale g_IsPrinting = FALSE; panel->m_ClipBox = tmp; diff --git a/share/wxprint.cpp b/share/wxprint.cpp index b941aaac41..329a54638e 100644 --- a/share/wxprint.cpp +++ b/share/wxprint.cpp @@ -830,10 +830,10 @@ void EDA_Printout::DrawPage() s_PrintMaskLayer |= EDGE_LAYER; #endif - panel->PrintPage( dc, 0, s_PrintMaskLayer ); + panel->PrintPage( dc, 0, s_PrintMaskLayer, s_PrintMirror ); #else - panel->PrintPage( dc, m_Print_Sheet_Ref, s_PrintMaskLayer ); + panel->PrintPage( dc, m_Print_Sheet_Ref, s_PrintMaskLayer, s_PrintMirror ); #endif g_IsPrinting = FALSE;