One more attempt to fix flipping geometry.

Fixes https://gitlab.com/kicad/code/kicad/issues/4480
This commit is contained in:
Jeff Young 2021-01-18 14:29:55 +00:00
parent 50e22de3ba
commit 4f399d4304
1 changed files with 11 additions and 9 deletions

View File

@ -179,21 +179,23 @@ void PCB_TEXT::Flip( const wxPoint& aCentre, bool aFlipLeftRight )
std::swap( top, bottom );
}
// Now put the text back in it (these look backwards but remember that out text will
// be mirrored when all is said and done)
// Now put the text back in its bounding box
switch( GetHorizJustify() )
{
case GR_TEXT_HJUSTIFY_LEFT: SetTextX( right ); break;
case GR_TEXT_HJUSTIFY_LEFT: SetTextX( IsMirrored() ? left : right ); break;
case GR_TEXT_HJUSTIFY_CENTER: SetTextX( ( left + right ) / 2 ); break;
case GR_TEXT_HJUSTIFY_RIGHT: SetTextX( left ); break;
case GR_TEXT_HJUSTIFY_RIGHT: SetTextX( IsMirrored() ? right : left ); break;
}
if( !aFlipLeftRight )
{
switch( GetVertJustify() )
{
case GR_TEXT_VJUSTIFY_TOP: SetTextY( bottom ); break;
case GR_TEXT_VJUSTIFY_CENTER: SetTextY( ( top + bottom ) / 2 ); break;
case GR_TEXT_VJUSTIFY_BOTTOM: SetTextY( top ); break;
}
}
// And restore orientation
if( KiROUND( angle ) != 0 )