Commit 0b7fd874 authored by Maciej Suminski's avatar Maciej Suminski
Browse files

Fixed printing issues under Linux.

parent ec8bf0c1
Loading
Loading
Loading
Loading
+11 −12
Original line number Diff line number Diff line
@@ -207,15 +207,10 @@ void GRResetPenAndBrush( wxDC* DC )
 */
void GRSetColorPen( wxDC* DC, EDA_COLOR_T Color, int width, wxPenStyle style )
{
    if( width < 0 )
        width = 0;

#ifdef __WXMAC__
    // Under OSX when wxPen is set to 0, cocoa follows the request drawing nothing &
    // in the bitmap world the minimum is enough to light a pixel, in vectorial one not
    // Under OSX and while printing when wxPen is set to 0, renderer follows the request drawing
    // nothing & in the bitmap world the minimum is enough to light a pixel, in vectorial one not
    if( width <= 1 )
        width = DC->DeviceToLogicalXRel( 1 );
#endif

    if( s_ForceBlackPen )
    {
@@ -341,7 +336,7 @@ void GRSetDrawMode( wxDC* DC, GR_DRAWMODE draw_mode )

        DC->SetLogicalFunction( wxINVERT );
#endif
    else
    else if( draw_mode & GR_COPY )
        DC->SetLogicalFunction( wxCOPY );

#ifdef USE_WX_OVERLAY
@@ -795,12 +790,16 @@ void GRFilledCircle( EDA_RECT* ClipBox, wxDC* DC, int x, int y, int r,
        y0 = ClipBox->GetY();
        xm = ClipBox->GetRight();
        ym = ClipBox->GetBottom();

        if( x < ( x0 - r ) )
            return;

        if( y < ( y0 - r ) )
            return;

        if( x > ( r + xm ) )
            return;

        if( y > ( r + ym ) )
            return;
    }
+0 −1
Original line number Diff line number Diff line
@@ -55,7 +55,6 @@ void DrawPageLayout( wxDC* aDC, EDA_RECT* aClipBox,
                     int aPenWidth, double aScalar,
                     EDA_COLOR_T aColor, EDA_COLOR_T aAltColor )
{
    GRSetDrawMode( aDC, GR_COPY );
    WS_DRAW_ITEM_LIST drawList;

    drawList.SetPenSize( aPenWidth );
+1 −1
Original line number Diff line number Diff line
@@ -37,13 +37,13 @@ class EDA_RECT;

/// Drawmode. Compositing mode plus a flag or two
enum GR_DRAWMODE {
    GR_COPY               = 0,
    GR_OR                 = 0x01000000,
    GR_XOR                = 0x02000000,
    GR_AND                = 0x04000000,
    GR_NXOR               = 0x08000000,
    GR_INVERT             = 0x10000000,
    GR_ALLOW_HIGHCONTRAST = 0x20000000,
    GR_COPY               = 0x40000000,
    GR_HIGHLIGHT          = 0x80000000,
    UNSPECIFIED_DRAWMODE  = -1
};
+5 −8
Original line number Diff line number Diff line
@@ -424,11 +424,10 @@ void D_PAD::DrawShape( EDA_RECT* aClipBox, wxDC* aDC, PAD_DRAWINFO& aDrawInfo )
            GRForceBlackPen( false );
            aDrawInfo.m_HoleColor = WHITE;
        }

        if( aDrawInfo.m_DrawMode != GR_XOR )
            GRSetDrawMode( aDC, GR_COPY );
        else
            GRSetDrawMode( aDC, GR_XOR );
        {
            GRSetDrawMode( aDC, ( aDrawInfo.m_DrawMode != GR_XOR ) ? GR_COPY : GR_XOR );
        }

        EDA_COLOR_T hole_color = aDrawInfo.m_HoleColor;

@@ -477,10 +476,8 @@ void D_PAD::DrawShape( EDA_RECT* aClipBox, wxDC* aDC, PAD_DRAWINFO& aDrawInfo )
                    holepos.x - dx0, holepos.y + dx0, 0, nc_color );
    }

    if( aDrawInfo.m_DrawMode != GR_XOR )
        GRSetDrawMode( aDC, GR_COPY );
    else
        GRSetDrawMode( aDC, GR_XOR );
    if( !aDrawInfo.m_IsPrinting )
        GRSetDrawMode( aDC, ( aDrawInfo.m_DrawMode != GR_XOR ) ? GR_COPY : GR_XOR );

    // Draw the pad number
    if( !aDrawInfo.m_Display_padnum && !aDrawInfo.m_Display_netname )
+2 −21
Original line number Diff line number Diff line
@@ -50,7 +50,7 @@ void FOOTPRINT_EDIT_FRAME::PrintPage( wxDC* aDC,
                                      bool  aPrintMirrorMode,
                                      void * aData)
{
    GR_DRAWMODE drawmode = GR_COPY;
    const GR_DRAWMODE drawmode = (GR_DRAWMODE) 0;
    int     defaultPenSize = Millimeter2iu( 0.2 );
    DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)GetDisplayOptions();

@@ -81,13 +81,6 @@ void FOOTPRINT_EDIT_FRAME::PrintPage( wxDC* aDC,

    m_canvas->SetPrintMirrored( aPrintMirrorMode );

    // The OR mode is used in color mode, but be aware the background *must be
    // BLACK.  In the print page dialog, we first print in BLACK, and after
    // reprint in color, on the black "local" background, in OR mode the black
    // print is not made before, only a white page is printed
    if( GetGRForceBlackPenState() == false )
        drawmode = GR_OR;

    // Draw footprints, this is done at last in order to print the pad holes in
    // white after the tracks and zones
    int tmp = D_PAD::m_PadSketchModePenSize;
@@ -117,7 +110,7 @@ void PCB_EDIT_FRAME::PrintPage( wxDC* aDC,
                                bool  aPrintMirrorMode,
                                void* aData)
{
    GR_DRAWMODE     drawmode = GR_COPY;
    const GR_DRAWMODE drawmode = (GR_DRAWMODE) 0;
    DISPLAY_OPTIONS save_opt;
    BOARD*          Pcb   = GetBoard();
    int             defaultPenSize = Millimeter2iu( 0.2 );
@@ -201,16 +194,6 @@ void PCB_EDIT_FRAME::PrintPage( wxDC* aDC,

    m_canvas->SetPrintMirrored( aPrintMirrorMode );

    // The OR mode is used in color mode, but be aware the background *must be
    // BLACK.  In the print page dialog, we first print in BLACK, and after
    // reprint in color, on the black "local" background, in OR mode the black
    // print is not made before, only a white page is printed
    if( GetGRForceBlackPenState() == false )
        drawmode = GR_OR;

    // Print the pcb graphic items (texts, ...)
    GRSetDrawMode( aDC, drawmode );

    for( BOARD_ITEM* item = Pcb->m_Drawings; item; item = item->Next() )
    {
        switch( item->Type() )
@@ -242,7 +225,6 @@ void PCB_EDIT_FRAME::PrintPage( wxDC* aDC,

            EDA_COLOR_T color = g_ColorsSettings.GetItemColor( VIAS_VISIBLE + via->GetViaType() );

            GRSetDrawMode( aDC, drawmode );
            GRFilledCircle( m_canvas->GetClipBox(), aDC,
                            via->GetStart().x,
                            via->GetStart().y,
@@ -295,7 +277,6 @@ void PCB_EDIT_FRAME::PrintPage( wxDC* aDC,
        bool blackpenstate = GetGRForceBlackPenState();

        GRForceBlackPen( false );
        GRSetDrawMode( aDC, GR_COPY );

        for( ; track; track = track->Next() )
        {
+1 −1

File changed.

Contains only whitespace changes.

+2 −2

File changed.

Contains only whitespace changes.

Loading