altium: it is always a good idea to test rotation with non 90° angles

This commit is contained in:
Thomas Pointhuber 2020-04-19 14:17:55 +02:00 committed by Jon Evans
parent aaa3f9eb74
commit a4fd993a4b
3 changed files with 11 additions and 1 deletions

View File

@ -280,6 +280,11 @@ ACOMPONENT6::ACOMPONENT6( ALTIUM_PARSER& aReader )
sourcelibreference =
ALTIUM_PARSER::PropertiesReadString( properties, "SOURCELIBREFERENCE", "" );
nameautoposition = static_cast<ALTIUM_TEXT_POSITION>(
ALTIUM_PARSER::PropertiesReadInt( properties, "NAMEAUTOPOSITION", 0 ) );
commentautoposition = static_cast<ALTIUM_TEXT_POSITION>(
ALTIUM_PARSER::PropertiesReadInt( properties, "COMMENTAUTOPOSITION", 0 ) );
if( aReader.HasParsingError() )
{
THROW_IO_ERROR( "Components6 stream was not parsed correctly" );

View File

@ -170,6 +170,7 @@ enum class ALTIUM_POLYGON_HATCHSTYLE
enum class ALTIUM_TEXT_POSITION
{
MANUAL = 0, // only relevant for NAMEAUTOPOSITION and COMMENTAUTOPOSITION
LEFT_TOP = 1,
LEFT_CENTER = 2,
LEFT_BOTTOM = 3,
@ -358,6 +359,10 @@ struct ACOMPONENT6
wxString sourcefootprintlibrary;
wxString sourcecomponentlibrary;
wxString sourcelibreference;
ALTIUM_TEXT_POSITION nameautoposition;
ALTIUM_TEXT_POSITION commentautoposition;
explicit ACOMPONENT6( ALTIUM_PARSER& aReader );
};

View File

@ -2061,7 +2061,7 @@ void ALTIUM_PCB::ParseTexts6Data(
{
double orientation =
static_cast<const MODULE*>( txm->GetParent() )->GetOrientation();
txm->SetTextAngle( orientation + txm->GetTextAngle() );
txm->SetTextAngle( txm->GetTextAngle() - orientation );
txm->SetLocalCoord();
}
}