FOOTPRINT::AutoPositionFields: reset justification and angle as well.

This commit is contained in:
Alex Shvartzkop 2023-09-07 03:50:51 +03:00
parent ebbc5fd4cb
commit 892761920a
1 changed files with 8 additions and 0 deletions

View File

@ -2196,12 +2196,20 @@ void FOOTPRINT::AutoPositionFields()
if( Reference().GetPosition() == VECTOR2I( 0, 0 ) )
{
Reference().SetHorizJustify( GR_TEXT_H_ALIGN_CENTER );
Reference().SetVertJustify( GR_TEXT_V_ALIGN_CENTER );
Reference().SetTextAngle( ANGLE_0 );
Reference().SetX( bbox.GetCenter().x );
Reference().SetY( bbox.GetTop() - Reference().GetTextSize().y / 2 );
}
if( Value().GetPosition() == VECTOR2I( 0, 0 ) )
{
Value().SetHorizJustify( GR_TEXT_H_ALIGN_CENTER );
Value().SetVertJustify( GR_TEXT_V_ALIGN_CENTER );
Value().SetTextAngle( ANGLE_0 );
Value().SetX( bbox.GetCenter().x );
Value().SetY( bbox.GetBottom() + Value().GetTextSize().y / 2 );
}