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

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
......@@ -74,13 +74,27 @@ WinEDA_SelColorFrame::WinEDA_SelColorFrame( wxWindow* parent,
GetSizer()->SetSizeHints( this );
// 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.
wxPoint endCornerPosition = GetPosition();
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.y += GetSize().y + margin;
wxPoint windowPosition = GetPosition();
windowPosition = GetPosition();
wxRect freeScreenArea( wxGetClientDisplayRect( ) );
if( freeScreenArea.GetRight() < endCornerPosition.x )
{
......
......@@ -94,7 +94,6 @@ bool WinEDA_GerberFrame::Read_GERBER_File( const wxString& GERBER_FullFileName,
gerber->m_CommandState = CMD_IDLE;
while( *text )
text++;
break;
case 'G': /* Line type Gxx : command */
......
......@@ -455,7 +455,9 @@ bool GERBER_IMAGE::Execute_G_Command( char*& text, int G_commande )
break;
case GC_COMMENT:
text = NULL;
// Skip comment
while ( *text && (*text != '*') )
text++;
break;
case GC_LINEAR_INTERPOL_10X:
......
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