From 6113bbf606878e9b82663b731213f1f71cb8155d Mon Sep 17 00:00:00 2001 From: Dick Hollenbeck Date: Fri, 14 Jan 2011 01:49:16 -0600 Subject: [PATCH] Brian's save grid origin patch --- pcbnew/ioascii.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/pcbnew/ioascii.cpp b/pcbnew/ioascii.cpp index 174f09b426..1bd4ab441d 100644 --- a/pcbnew/ioascii.cpp +++ b/pcbnew/ioascii.cpp @@ -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,