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