diff --git a/common/eda_text.cpp b/common/eda_text.cpp index fdadf86c82..35983951af 100644 --- a/common/eda_text.cpp +++ b/common/eda_text.cpp @@ -295,7 +295,7 @@ void EDA_TEXT::Draw( EDA_RECT* aClipBox, wxDC* aDC, const wxPoint& aOffset, void EDA_TEXT::GetPositionsOfLinesOfMultilineText( - std::vector& aPositions, int aLineCount ) + std::vector& aPositions, int aLineCount ) const { wxPoint pos = m_Pos; // Position of first line of the // multiline text according to diff --git a/include/eda_text.h b/include/eda_text.h index 7de9dbd2c7..a114e56f1a 100644 --- a/include/eda_text.h +++ b/include/eda_text.h @@ -275,7 +275,7 @@ public: * for efficiency reasons */ void GetPositionsOfLinesOfMultilineText( - std::vector& aPositions, int aLineCount ); + std::vector& aPositions, int aLineCount ) const; /** * Function Format * outputs the object to \a aFormatter in s-expression form. diff --git a/pcbnew/board_items_to_polygon_shape_transform.cpp b/pcbnew/board_items_to_polygon_shape_transform.cpp index c18dbc3d19..66c5c7afa6 100644 --- a/pcbnew/board_items_to_polygon_shape_transform.cpp +++ b/pcbnew/board_items_to_polygon_shape_transform.cpp @@ -290,22 +290,19 @@ void TEXTE_PCB::TransformShapeWithClearanceToPolygonSet( if( IsMultilineAllowed() ) { - wxPoint pos = GetTextPosition(); wxArrayString* list = wxStringSplit( GetText(), '\n' ); - wxPoint offset; + std::vector positions; + positions.reserve( list->Count() ); + GetPositionsOfLinesOfMultilineText( positions, list->Count() ); - offset.y = GetInterline(); - RotatePoint( &offset, GetOrientation() ); - - for( unsigned i = 0; iCount(); i++ ) + for( unsigned ii = 0; ii < list->Count(); ii++ ) { - wxString txt = list->Item( i ); - DrawGraphicText( NULL, NULL, pos, color, + wxString txt = list->Item( ii ); + DrawGraphicText( NULL, NULL, positions[ii], color, txt, GetOrientation(), size, GetHorizJustify(), GetVertJustify(), GetThickness(), IsItalic(), true, addTextSegmToPoly ); - pos += offset; } delete list;