Commit 5f777f8c authored by charras's avatar charras
Browse files

pcbnew: bug solved: pad holes not printed

parent f98fd09f
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -5,6 +5,12 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
email address.

2008-Aug-09 UPDATE   Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+pcbnew:
    bug solved: pads holes not printed.
+eeschema
    enforced controls against malformed libraries

2008-Aug-06 UPDATE   Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+12 −0
Original line number Diff line number Diff line
@@ -320,10 +320,22 @@ void GRSetBrush( wxDC* DC, int Color, int fill )
/*************************************/
void GRForceBlackPen( bool flagforce )
/*************************************/
/** function GRForceBlackPen
 * @param flagforce True to force a black pen whenever the asked color
 */
{
    ForceBlackPen = flagforce;
}

/***********************************/
bool GetGRForceBlackPenState( void )
/***********************************/
/** function GetGRForceBlackPenState
 * @return ForceBlackPen (True if  a black pen was forced)
 */
{
    return ForceBlackPen;
}

/************************************************************/
/* routines de controle et positionnement du curseur souris */
+9 −0
Original line number Diff line number Diff line
@@ -67,7 +67,16 @@ int GRGetDrawMode(wxDC * DC);
void GRResetPenAndBrush(wxDC * DC);
void GRSetColorPen(wxDC * DC, int Color , int width = 1, int stype = wxSOLID);
void GRSetBrush(wxDC * DC, int Color , int fill = 0);

/** function GRForceBlackPen
 * @param flagforce True to force a black pen whenever the asked color
 */
void GRForceBlackPen(bool flagforce );

/** function GetGRForceBlackPenState
 * @return ForceBlackPen (True if  a black pen was forced)
 */
bool GetGRForceBlackPenState( void );
void SetPenMinWidth(int minwidth); /* ajustage de la largeur mini de plume */

void GRLine(EDA_Rect * ClipBox, wxDC * DC, int x1, int y1, int x2, int y2, int width, int Color);
+3 −44
Original line number Diff line number Diff line
@@ -571,7 +571,7 @@ int MODULE::ReadDescr( FILE* File, int* LineNum )
    EDA_BaseStruct* LastModStruct = NULL;
    EDGE_MODULE*    DrawSegm;
    TEXTE_MODULE*   DrawText;
    char            Line[256], BufLine[256], BufCar1[128], BufCar2[128], * PtLine;
    char            Line[256], BufLine[256], BufCar1[128], * PtLine;
    int             itmp1, itmp2;

    while( GetLine( File, Line, LineNum, sizeof(Line) - 1 ) != NULL )
@@ -672,7 +672,7 @@ int MODULE::ReadDescr( FILE* File, int* LineNum )
            }
            break;

        case 'T':    /* lecture des textes modules */
        case 'T':    /* Read a footprint text description (ref, value, or drawing */
            sscanf( Line + 1, "%d", &itmp1 );
            if( itmp1 == TEXT_is_REFERENCE )
                DrawText = m_Reference;
@@ -694,48 +694,7 @@ int MODULE::ReadDescr( FILE* File, int* LineNum )
                LastModStruct = DrawText;
            }

            int layer;
            sscanf( Line + 1, "%d %d %d %d %d %d %d %s %s %d",
                &itmp1,
                &DrawText->m_Pos0.x, &DrawText->m_Pos0.y,
                &DrawText->m_Size.y, &DrawText->m_Size.x,
                &DrawText->m_Orient, &DrawText->m_Width,
                BufCar1, BufCar2, &layer );

            DrawText->m_Type    = itmp1;
            DrawText->m_Orient -= m_Orient;     // m_Orient texte relative au module
            if( BufCar1[0] == 'M' )
                DrawText->m_Miroir = 0;
            else
                DrawText->m_Miroir = 1;
            if( BufCar2[0]  == 'I' )
                DrawText->m_NoShow = 1;
            else
                DrawText->m_NoShow = 0;

            if( layer == COPPER_LAYER_N )
                layer = SILKSCREEN_N_CU;
            else if( layer == CMP_N )
                layer = SILKSCREEN_N_CMP;

            DrawText->SetLayer( layer );

            /* calcul de la position vraie */
            DrawText->SetDrawCoord();
            /* Lecture de la chaine "text" */
            ReadDelimitedText( BufLine, Line, sizeof(BufLine) );
            DrawText->m_Text = CONV_FROM_UTF8( BufLine );

            // Test for a reasonnable width:
            if( DrawText->m_Width <= 1 )
                DrawText->m_Width = 1;
            if( DrawText->m_Width > TEXTS_MAX_WIDTH )
                DrawText->m_Width = TEXTS_MAX_WIDTH;
            // Test for a reasonnable size:
            if ( DrawText->m_Size.x < TEXTS_MIN_SIZE )
                DrawText->m_Size.x = TEXTS_MIN_SIZE;
            if ( DrawText->m_Size.y < TEXTS_MIN_SIZE )
                DrawText->m_Size.y = TEXTS_MIN_SIZE;
            DrawText->ReadDescr( Line, File, LineNum );
            break;

        case 'D':    /* lecture du contour */
+11 −1
Original line number Diff line number Diff line
@@ -550,7 +550,15 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoin

    if( fillpad && hole )
    {
        color = g_IsPrinting ? WHITE : BLACK; // ou DARKGRAY;
        bool blackpenstate = false;
        if ( g_IsPrinting )
        {
            blackpenstate = GetGRForceBlackPenState( );
            GRForceBlackPen( false );
            color = WHITE;
        }
        else
            color = BLACK; // or DARKGRAY;

        if( draw_mode != GR_XOR )
            GRSetDrawMode( DC, GR_COPY );
@@ -589,6 +597,8 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoin
        default:
            break;
        }
        if ( g_IsPrinting )
            GRForceBlackPen( blackpenstate );
    }

    GRSetDrawMode( DC, draw_mode );
Loading