Adjust left- or right-justified text for mirroring.

This commit is contained in:
Jeff Young 2019-04-07 00:17:12 +01:00
parent 615c49315f
commit 97063440bb
2 changed files with 19 additions and 0 deletions

View File

@ -175,6 +175,15 @@ void TEXTE_PCB::Flip( const wxPoint& aCentre )
SetLayer( FlipLayer( GetLayer(), copperLayerCount ) );
SetMirrored( !IsMirrored() );
// adjust justified text for mirroring
if( GetHorizJustify() == GR_TEXT_HJUSTIFY_LEFT || GetHorizJustify() == GR_TEXT_HJUSTIFY_RIGHT )
{
if( ( GetHorizJustify() == GR_TEXT_HJUSTIFY_RIGHT ) == IsMirrored() )
SetTextX( GetTextPos().x - GetTextBox().GetWidth() );
else
SetTextX( GetTextPos().x + GetTextBox().GetWidth() );
}
}

View File

@ -143,6 +143,16 @@ void TEXTE_MODULE::Flip( const wxPoint& aCentre )
SetLayer( FlipLayer( GetLayer() ) );
SetMirrored( IsBackLayer( GetLayer() ) );
SetLocalCoord();
// adjust justified text for mirroring
if( GetHorizJustify() == GR_TEXT_HJUSTIFY_LEFT || GetHorizJustify() == GR_TEXT_HJUSTIFY_RIGHT )
{
if( ( GetHorizJustify() == GR_TEXT_HJUSTIFY_RIGHT ) == IsMirrored() )
m_Pos0.x -= GetTextBox().GetWidth();
else
m_Pos0.x += GetTextBox().GetWidth();
SetDrawCoord();
}
}
bool TEXTE_MODULE::IsParentFlipped() const