Commit a0c413a6 authored by charras's avatar charras

solved a minor bug (pcbnew): arcs incorrectly printed in mirror mode

parent c88f9b1c
......@@ -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();
......
......@@ -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();
......
......@@ -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;
}
......
......@@ -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 );
......
......@@ -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 );
......
......@@ -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;
......
......@@ -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)
......
......@@ -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;
}
......
......@@ -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;
......
......@@ -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;
......
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