diff --git a/common/eda_text.cpp b/common/eda_text.cpp index 93a971383a..91cfb68056 100644 --- a/common/eda_text.cpp +++ b/common/eda_text.cpp @@ -603,14 +603,14 @@ void EDA_TEXT::TransformTextShapeToSegmentList( std::vector& aCornerBuf for( unsigned ii = 0; ii < strings_list.Count(); ii++ ) { wxString txt = strings_list.Item( ii ); - GRText( NULL, positions[ii], color, txt, GetTextAngle(), size, GetHorizJustify(), + GRText( NULL, positions[ii], color, txt, GetDrawRotation(), size, GetHorizJustify(), GetVertJustify(), penWidth, IsItalic(), forceBold, addTextSegmToBuffer, &aCornerBuffer ); } } else { - GRText( NULL, GetTextPos(), color, GetText(), GetTextAngle(), size, GetHorizJustify(), + GRText( NULL, GetTextPos(), color, GetText(), GetDrawRotation(), size, GetHorizJustify(), GetVertJustify(), penWidth, IsItalic(), forceBold, addTextSegmToBuffer, &aCornerBuffer ); } @@ -631,6 +631,12 @@ std::shared_ptr EDA_TEXT::GetEffectiveTextShape( ) const } +double EDA_TEXT::GetDrawRotation() const +{ + return GetTextAngle(); +} + + static struct EDA_TEXT_DESC { EDA_TEXT_DESC() diff --git a/include/eda_text.h b/include/eda_text.h index b36680efb1..d3a2cb0663 100644 --- a/include/eda_text.h +++ b/include/eda_text.h @@ -367,6 +367,8 @@ public: */ virtual void Format( OUTPUTFORMATTER* aFormatter, int aNestLevel, int aControlBits ) const; + virtual double GetDrawRotation() const; + private: wxString m_text; wxString m_shown_text; // Cache of unescaped text for efficient access diff --git a/pcbnew/class_text_mod.cpp b/pcbnew/class_text_mod.cpp index 4cd62fd4fa..4a821ae99b 100644 --- a/pcbnew/class_text_mod.cpp +++ b/pcbnew/class_text_mod.cpp @@ -457,7 +457,10 @@ wxString TEXTE_MODULE::GetShownText( int aDepth ) const std::shared_ptr TEXTE_MODULE::GetEffectiveShape( PCB_LAYER_ID aLayer ) const { - return GetEffectiveTextShape(); + const MODULE* module = static_cast( GetParent() ); + auto shape = GetEffectiveTextShape(); + + return shape; } diff --git a/pcbnew/class_text_mod.h b/pcbnew/class_text_mod.h index 220d01ff25..dbf4ddbe9c 100644 --- a/pcbnew/class_text_mod.h +++ b/pcbnew/class_text_mod.h @@ -181,7 +181,7 @@ public: * @return the text rotation for drawings and plotting * the footprint rotation is taken in account */ - double GetDrawRotation() const; + virtual double GetDrawRotation() const override; double GetDrawRotationRadians() const { return GetDrawRotation() * M_PI/1800; } // Virtual function