From 30ac8de73444a3dbb163cf61a61a7f2afd2fd52e Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 19 Mar 2021 19:33:06 +0000 Subject: [PATCH] Honour component transforms when rotating fields. Fixes https://gitlab.com/kicad/code/kicad/issues/7964 --- eeschema/sch_field.cpp | 8 ++++---- eeschema/sch_field.h | 2 +- eeschema/sch_item.h | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/eeschema/sch_field.cpp b/eeschema/sch_field.cpp index 11a1efda46..e128c3415d 100644 --- a/eeschema/sch_field.cpp +++ b/eeschema/sch_field.cpp @@ -435,11 +435,11 @@ bool SCH_FIELD::Replace( const wxFindReplaceData& aSearchData, void* aAuxData ) } -void SCH_FIELD::Rotate( wxPoint aPosition ) +void SCH_FIELD::Rotate( wxPoint aCenter ) { - wxPoint pt = GetTextPos(); - RotatePoint( &pt, aPosition, 900 ); - SetTextPos( pt ); + wxPoint pt = GetPosition(); + RotatePoint( &pt, aCenter, 900 ); + SetPosition( pt ); } diff --git a/eeschema/sch_field.h b/eeschema/sch_field.h index 884377909c..65474e606f 100644 --- a/eeschema/sch_field.h +++ b/eeschema/sch_field.h @@ -157,7 +157,7 @@ public: Offset( aMoveVector ); } - void Rotate( wxPoint aPosition ) override; + void Rotate( wxPoint aCenter ) override; /** * @copydoc SCH_ITEM::MirrorVertically() diff --git a/eeschema/sch_item.h b/eeschema/sch_item.h index df15864fc1..77982182cd 100644 --- a/eeschema/sch_item.h +++ b/eeschema/sch_item.h @@ -328,9 +328,9 @@ public: virtual void MirrorVertically( int aCenter ) = 0; /** - * Rotate the item around \a aPosition 90 degrees in the clockwise direction. + * Rotate the item around \a aCenter 90 degrees in the clockwise direction. */ - virtual void Rotate( wxPoint aPosition ) = 0; + virtual void Rotate( wxPoint aCenter ) = 0; /** * Add the schematic item end points to \a aItemList if the item has end points.