CADSTAR PCB Archive Importer: Fix imported Text Angle when mirrored

Angle needs to be negated in KiCad
This commit is contained in:
Roberto Fernandez Bautista 2020-10-18 18:26:31 +01:00 committed by Jon Evans
parent 7839a508b3
commit 6fb338d136
1 changed files with 7 additions and 0 deletions

View File

@ -1572,6 +1572,10 @@ void CADSTAR_PCB_ARCHIVE_LOADER::drawCadstarText( const TEXT& aCadstarText,
txt->SetPosition( rotatedTextPos );
txt->SetTextAngle( getAngleTenthDegree( aCadstarText.OrientAngle ) + aRotationAngle );
if( !aCadstarText.Mirror != !aMirrorInvert ) // If mirroring, invert angle to match CADSTAR
txt->SetTextAngle( -txt->GetTextAngle() );
txt->SetMirrored( aCadstarText.Mirror );
TEXTCODE tc = getTextCode( aCadstarText.TextCodeID );
@ -2165,6 +2169,9 @@ void CADSTAR_PCB_ARCHIVE_LOADER::addAttribute( const ATTRIBUTE_LOCATION& aCadsta
txt->SetTextAngle(
getAngleTenthDegree( aCadstarAttrLoc.OrientAngle ) - aModule->GetOrientation() );
if( aCadstarAttrLoc.Mirror ) // If mirroring, invert angle to match CADSTAR
txt->SetTextAngle( -txt->GetTextAngle() );
TEXTCODE tc = getTextCode( aCadstarAttrLoc.TextCodeID );
txt->SetTextThickness( getKiCadLength( tc.LineWidth ) );