Support mirroring of multiple SCH_FIELDs at once.

Fixes https://gitlab.com/kicad/code/kicad/issues/12512
This commit is contained in:
Jeff Young 2022-09-26 17:34:27 +01:00
parent 58874a591b
commit d0ff90eb6e
1 changed files with 12 additions and 0 deletions

View File

@ -928,6 +928,18 @@ int SCH_EDIT_TOOL::Mirror( const TOOL_EVENT& aEvent )
pin->MirrorHorizontally( sheet->GetBoundingBox().GetCenter().x );
}
}
else if( item->Type() == SCH_FIELD_T )
{
SCH_FIELD* field = static_cast<SCH_FIELD*>( item );
if( vertical )
field->SetVertJustify( TO_VJUSTIFY( -field->GetVertJustify() ) );
else
field->SetHorizJustify( TO_HJUSTIFY( -field->GetHorizJustify() ) );
// Now that we're re-justifying a field, they're no longer autoplaced.
static_cast<SCH_ITEM*>( field->GetParent() )->ClearFieldsAutoplaced();
}
else
{
if( vertical )