Brian's save grid origin patch

This commit is contained in:
Dick Hollenbeck 2011-01-14 01:49:16 -06:00
parent f9af593ee3
commit 6113bbf606
1 changed files with 25 additions and 0 deletions

View File

@ -549,6 +549,23 @@ int WinEDA_BasePcbFrame::ReadSetup( FILE* File, int* LineNum )
continue;
}
if( stricmp( Line, "GridOrigin" ) == 0 )
{
int Ox = 0;
int Oy = 0;
Ox = atoi( data );
data = strtok( NULL, " =\n\r" );
if ( data )
Oy = atoi( data );
GetScreen()->m_GridOrigin.x = Ox;
GetScreen()->m_GridOrigin.y = Oy;
continue;
}
#endif
}
@ -687,6 +704,14 @@ static int WriteSetup( FILE* aFile, WinEDA_BasePcbFrame* aFrame, BOARD* aBoard )
"Pad2PasteClearanceRatio %g\n",
aBoard->GetBoardDesignSettings()->m_SolderPasteMarginRatio );
if ( aFrame->GetScreen()->m_GridOrigin != wxPoint( 0, 0 ) )
{
fprintf( aFile,
"GridOrigin %d %d\n",
aFrame->GetScreen()->m_GridOrigin.x,
aFrame->GetScreen()->m_GridOrigin.y );
}
fprintf( aFile,
"AuxiliaryAxisOrg %d %d\n",
aFrame->m_Auxiliary_Axis_Position.x,