From 83162364e7701b42456e52f1add71ef301636ebc Mon Sep 17 00:00:00 2001 From: Mikolaj Wielgus Date: Fri, 3 Dec 2021 01:40:06 +0100 Subject: [PATCH] Restore old rotation behavior for SCH_LABEL Fixes https://gitlab.com/kicad/code/kicad/issues/9861 --- eeschema/sch_text.cpp | 12 ++++++++++++ eeschema/sch_text.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/eeschema/sch_text.cpp b/eeschema/sch_text.cpp index 20ada275a8..8d350ee97b 100644 --- a/eeschema/sch_text.cpp +++ b/eeschema/sch_text.cpp @@ -927,6 +927,18 @@ const EDA_RECT SCH_LABEL::GetBoundingBox() const } +void SCH_LABEL::Rotate( const wxPoint& aCenter ) +{ + wxPoint pt = GetTextPos(); + RotatePoint( &pt, aCenter, 900 ); + wxPoint offset = pt - GetTextPos(); + + Rotate90( false ); + + SetTextPos( GetTextPos() + offset ); +} + + wxString SCH_LABEL::GetSelectMenuText( EDA_UNITS aUnits ) const { return wxString::Format( _( "Label '%s'" ), ShortenedShownText() ); diff --git a/eeschema/sch_text.h b/eeschema/sch_text.h index f116bb4b33..d582150500 100644 --- a/eeschema/sch_text.h +++ b/eeschema/sch_text.h @@ -300,6 +300,8 @@ public: const EDA_RECT GetBoundingBox() const override; + void Rotate( const wxPoint& aCenter ) override; + bool IsConnectable() const override { return true; } bool CanConnect( const SCH_ITEM* aItem ) const override