LIB_TEXT: fix incorrect position of the drawn text.

Fixes #10654
https://gitlab.com/kicad/code/kicad/issues/10654
This commit is contained in:
jean-pierre charras 2022-01-30 09:11:16 +01:00
parent cc2a897e2b
commit b4826ce304
1 changed files with 5 additions and 0 deletions

View File

@ -903,6 +903,11 @@ void SCH_PAINTER::draw( const LIB_TEXT* aText, int aLayer )
TEXT_ATTRIBUTES attrs = aText->GetAttributes(); TEXT_ATTRIBUTES attrs = aText->GetAttributes();
attrs.m_StrokeWidth = getTextThickness( aText, drawingShadows ); attrs.m_StrokeWidth = getTextThickness( aText, drawingShadows );
// Because the text position is the bounding box center, the text
// is drawn as centered.
attrs.m_Halign = GR_TEXT_H_ALIGN_CENTER;
attrs.m_Valign = GR_TEXT_V_ALIGN_CENTER;
strokeText( aText->GetText(), pos, attrs ); strokeText( aText->GetText(), pos, attrs );
} }
} }