From d0ff90eb6ee9b2897498fa4610c8edbf1323edd9 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 26 Sep 2022 17:34:27 +0100 Subject: [PATCH] Support mirroring of multiple SCH_FIELDs at once. Fixes https://gitlab.com/kicad/code/kicad/issues/12512 --- eeschema/tools/sch_edit_tool.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/eeschema/tools/sch_edit_tool.cpp b/eeschema/tools/sch_edit_tool.cpp index db92622057..6a4ee9b06c 100644 --- a/eeschema/tools/sch_edit_tool.cpp +++ b/eeschema/tools/sch_edit_tool.cpp @@ -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( 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( field->GetParent() )->ClearFieldsAutoplaced(); + } else { if( vertical )