Commit 7873b46e authored by jean-pierre charras's avatar jean-pierre charras
Browse files

Gerbview: fix an issue with gerber files having a line comment starting by G04...

Gerbview: fix an issue with gerber files having a line comment starting by G04 and a command after this comment, on the same line.
parent ec35a66f
Loading
Loading
Loading
Loading
+16 −2
Original line number Original line Diff line number Diff line
@@ -74,13 +74,27 @@ WinEDA_SelColorFrame::WinEDA_SelColorFrame( wxWindow* parent,
    GetSizer()->SetSizeHints( this );
    GetSizer()->SetSizeHints( this );


    // Ensure the whole frame is visible, whenever the asked position.
    // Ensure the whole frame is visible, whenever the asked position.
    // Moreover with a work station having dual monitors, the asked position can be relative to a monitor
    // and this frame can be displayed on the other monitor, with an "out of screen" position.
    // Give also a small margin.
    // Give also a small margin.
    wxPoint endCornerPosition = GetPosition();
    int margin = 10;
    int margin = 10;
    wxPoint windowPosition = GetPosition();
    if( framepos != wxDefaultPosition )
    {
        if( windowPosition.x < margin )
            windowPosition.x = margin;
        // Under MACOS, a vertical margin >= 20 is needed by the system menubar
        int v_margin = MAX(20, margin);
        if( windowPosition.y < v_margin )
            windowPosition.y = v_margin;
        if( windowPosition != framepos )
            SetPosition(windowPosition);
    }
    wxPoint endCornerPosition = GetPosition();
    endCornerPosition.x += GetSize().x + margin;
    endCornerPosition.x += GetSize().x + margin;
    endCornerPosition.y += GetSize().y + margin;
    endCornerPosition.y += GetSize().y + margin;


    wxPoint windowPosition = GetPosition();
    windowPosition = GetPosition();
    wxRect freeScreenArea( wxGetClientDisplayRect( ) );
    wxRect freeScreenArea( wxGetClientDisplayRect( ) );
    if( freeScreenArea.GetRight() < endCornerPosition.x )
    if( freeScreenArea.GetRight() < endCornerPosition.x )
    {
    {
+0 −1
Original line number Original line Diff line number Diff line
@@ -94,7 +94,6 @@ bool WinEDA_GerberFrame::Read_GERBER_File( const wxString& GERBER_FullFileName,
                gerber->m_CommandState = CMD_IDLE;
                gerber->m_CommandState = CMD_IDLE;
                while( *text )
                while( *text )
                    text++;
                    text++;

                break;
                break;


            case 'G':    /* Line type Gxx : command */
            case 'G':    /* Line type Gxx : command */
+3 −1
Original line number Original line Diff line number Diff line
@@ -455,7 +455,9 @@ bool GERBER_IMAGE::Execute_G_Command( char*& text, int G_commande )
        break;
        break;


    case GC_COMMENT:
    case GC_COMMENT:
        text = NULL;
        // Skip comment
        while ( *text && (*text != '*') )
            text++;
        break;
        break;


    case GC_LINEAR_INTERPOL_10X:
    case GC_LINEAR_INTERPOL_10X: