Fix Eagle plugin board free text rotation import bug.

When using angle's other than 90, 180, and 270, the Eagle plugin did not
correctly set the text angle.
This commit is contained in:
Lachlan Audas 2017-04-14 08:30:57 -04:00 committed by Wayne Stambaugh
parent c4ea54227e
commit a208ba6566
1 changed files with 20 additions and 0 deletions

View File

@ -1510,6 +1510,26 @@ void EAGLE_PLUGIN::loadPlain( CPTREE& aGraphics )
pcbtxt->SetTextAngle( sign * 90 * 10 );
align = ETEXT::TOP_RIGHT;
}
else // Ok so text is not at 90,180 or 270 so do some funny stuf to get placement right
{
if( ( degrees > 0 ) && ( degrees < 90 ) )
pcbtxt->SetTextAngle( sign * t.rot->degrees * 10 );
else if( ( degrees > 90 ) && ( degrees < 180 ) )
{
pcbtxt->SetTextAngle( sign * ( t.rot->degrees + 180 ) * 10 );
align = ETEXT::TOP_RIGHT;
}
else if( ( degrees > 180 ) && ( degrees < 270 ) )
{
pcbtxt->SetTextAngle( sign * ( t.rot->degrees - 180 ) * 10 );
align = ETEXT::TOP_RIGHT;
}
else if( ( degrees > 270 ) && ( degrees < 360 ) )
{
pcbtxt->SetTextAngle( sign * t.rot->degrees * 10 );
align = ETEXT::BOTTOM_LEFT;
}
}
}
switch( align )