Commit 663959f4 authored by charras's avatar charras
Browse files

fixed: eeschema: incorrect default position of void fields when loading schematic files

parent b0a2d7a4
Loading
Loading
Loading
Loading
+57 −50
Original line number Diff line number Diff line
@@ -18,8 +18,7 @@ SCH_ITEM* ReadTextDescr( FILE * aFile,
                         char* aLine,
                         int aBufsize,
                         int* aLineNum,
                         int aSchematicFileVersion)
{
                         int aSchematicFileVersion ) {
/**
 * Function ReadTextDescr
 * Reads the data structures for a Text (Comment, label, Hlabel and Hlabel
@@ -605,6 +604,14 @@ int ReadPartDescr( wxWindow* frame, char* Line, FILE* f,
        {
            sscanf( Line + 1, "%d %d",
                    &component->m_Pos.x, &component->m_Pos.y );

            // Set fields position to a default position (that is the component position
            // For existing fields, the real position will be set later
            for( int i = 0; i<component->GetFieldCount();  ++i )
            {
                if( component->GetField( i )->m_Text.IsEmpty() )
                    component->GetField( i )->m_Pos = component->m_Pos;
            }
        }
        else if( Line[0] == 'A' && Line[1] == 'R' )
        {
@@ -745,7 +752,8 @@ int ReadPartDescr( wxWindow* frame, char* Line, FILE* f,
                else
                    component->GetField( fieldNdx )->m_Italic = false;
                if( Char3[2] == 'B' )
                    component->GetField( fieldNdx )->m_Width = component->GetField( fieldNdx )->m_Size.x / 4;
                    component->GetField( fieldNdx )->m_Width = component->GetField( fieldNdx )->
                                                               m_Size.x / 4;
                else
                    component->GetField( fieldNdx )->m_Width = 0;

@@ -812,4 +820,3 @@ int ReadPartDescr( wxWindow* frame, char* Line, FILE* f,

    return Failed;   /* Fin lecture 1 composant */
}
+106 B (171 KiB)

File changed.

No diff preview for this file type.

+1341 −569

File changed.

Preview size limit exceeded, changes collapsed.