altium: improve text rotation in modules, make variable comparison case insensitive

This commit is contained in:
Thomas Pointhuber 2020-04-19 11:36:57 +02:00 committed by Jon Evans
parent 0542ce2ae2
commit aaa3f9eb74
1 changed files with 7 additions and 9 deletions

View File

@ -2032,15 +2032,16 @@ void ALTIUM_PCB::ParseTexts6Data(
itm = txm; itm = txm;
} }
if( elem.text == ".Designator" && !elem.isDesignator ) wxString trimmedText = elem.text.Trim();
if( !elem.isDesignator && trimmedText.CmpNoCase( ".Designator" ) == 0 )
{ {
tx->SetText( "${REFERENCE}" ); tx->SetText( "${REFERENCE}" );
} }
else if( elem.text == ".Comment" && !elem.isComment ) else if( !elem.isComment && trimmedText.CmpNoCase( ".Comment" ) == 0 )
{ {
tx->SetText( "${VALUE}" ); tx->SetText( "${VALUE}" );
} }
else if( elem.text == ".Layer_Name" ) else if( trimmedText.CmpNoCase( ".Layer_Name" ) == 0 )
{ {
tx->SetText( "${LAYER}" ); tx->SetText( "${LAYER}" );
} }
@ -2057,13 +2058,10 @@ void ALTIUM_PCB::ParseTexts6Data(
TEXTE_MODULE* txm = dynamic_cast<TEXTE_MODULE*>( tx ); TEXTE_MODULE* txm = dynamic_cast<TEXTE_MODULE*>( tx );
if( txm ) if( txm )
{
if( elem.isDesignator || elem.isComment )
{ {
double orientation = double orientation =
static_cast<const MODULE*>( txm->GetParent() )->GetOrientation(); static_cast<const MODULE*>( txm->GetParent() )->GetOrientation();
txm->SetTextAngle( orientation + txm->GetTextAngle() ); txm->SetTextAngle( orientation + txm->GetTextAngle() );
}
txm->SetLocalCoord(); txm->SetLocalCoord();
} }
} }