Eeschema Eagle Import: During recentering of items the sheet, round translation to 100 mils to keep items on the grid.

This commit is contained in:
Russell Oliver 2017-07-09 15:19:06 +10:00 committed by Maciej Suminski
parent 2db2319156
commit 23dc8fdf32
1 changed files with 5 additions and 1 deletions

View File

@ -535,9 +535,13 @@ void SCH_EAGLE_PLUGIN::loadSheet( wxXmlNode* aSheetNode )
pageSizeIU = m_currentSheet->GetScreen()->GetPageSettings().GetSizeIU();
wxPoint sheetcentre( pageSizeIU.x / 2, pageSizeIU.y / 2 );
// round the translation to nearest 100mil.
wxPoint translation = sheetcentre- itemsCentre;
translation.x = translation.x - translation.x%100;
translation.y = translation.y - translation.y%100;
while( item )
{
item->SetPosition( item->GetPosition() - itemsCentre + sheetcentre );
item->SetPosition( item->GetPosition() +translation);
item = item->Next();
}
}