Fix mirroring of TextBox.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15576
This commit is contained in:
Jeff Young 2023-09-18 14:47:38 +01:00
parent 5b77716ed8
commit 469a94db8c
3 changed files with 6 additions and 5 deletions

View File

@ -359,10 +359,10 @@ bool DIALOG_TEXTBOX_PROPERTIES::TransferDataFromWindow()
m_textBox->SetBorderEnabled( m_borderCheckbox->GetValue() );
STROKE_PARAMS stroke = m_textBox->GetStroke();
if( !m_borderWidth.IsIndeterminate() )
stroke.SetWidth( m_borderWidth.GetValue() );
auto it = lineTypeNames.begin();
std::advance( it, m_borderStyleCombo->GetSelection() );

View File

@ -1971,8 +1971,8 @@ void PCB_PAINTER::strokeText( const wxString& aText, const VECTOR2I& aPosition,
m_gal->SetIsStroke( font->IsStroke() );
VECTOR2I pos( aPosition );
VECTOR2I fudge
{ KiROUND( 0.16 * aAttrs.m_StrokeWidth ), 0 };
VECTOR2I fudge( KiROUND( 0.16 * aAttrs.m_StrokeWidth ), 0 );
RotatePoint( fudge, aAttrs.m_Angle );
if( ( aAttrs.m_Halign == GR_TEXT_H_ALIGN_LEFT && !aAttrs.m_Mirrored )

View File

@ -191,10 +191,11 @@ VECTOR2I PCB_TEXTBOX::GetDrawPos() const
VECTOR2I textAnchor;
VECTOR2I offset;
if( IsMirrored() )
{
if( IsBackLayer( GetLayer() ) )
std::swap( corners[0], corners[1] );
if( IsMirrored() )
{
switch( GetHorizJustify() )
{
case GR_TEXT_H_ALIGN_LEFT: effectiveAlignment = GR_TEXT_H_ALIGN_RIGHT; break;