Pcbnew, 3D viewer: fix incorrect position of multiline texts.
This commit is contained in:
parent
517ca83fbc
commit
f9cc325bd8
|
@ -295,7 +295,7 @@ void EDA_TEXT::Draw( EDA_RECT* aClipBox, wxDC* aDC, const wxPoint& aOffset,
|
||||||
|
|
||||||
|
|
||||||
void EDA_TEXT::GetPositionsOfLinesOfMultilineText(
|
void EDA_TEXT::GetPositionsOfLinesOfMultilineText(
|
||||||
std::vector<wxPoint>& aPositions, int aLineCount )
|
std::vector<wxPoint>& aPositions, int aLineCount ) const
|
||||||
{
|
{
|
||||||
wxPoint pos = m_Pos; // Position of first line of the
|
wxPoint pos = m_Pos; // Position of first line of the
|
||||||
// multiline text according to
|
// multiline text according to
|
||||||
|
|
|
@ -275,7 +275,7 @@ public:
|
||||||
* for efficiency reasons
|
* for efficiency reasons
|
||||||
*/
|
*/
|
||||||
void GetPositionsOfLinesOfMultilineText(
|
void GetPositionsOfLinesOfMultilineText(
|
||||||
std::vector<wxPoint>& aPositions, int aLineCount );
|
std::vector<wxPoint>& aPositions, int aLineCount ) const;
|
||||||
/**
|
/**
|
||||||
* Function Format
|
* Function Format
|
||||||
* outputs the object to \a aFormatter in s-expression form.
|
* outputs the object to \a aFormatter in s-expression form.
|
||||||
|
|
|
@ -290,22 +290,19 @@ void TEXTE_PCB::TransformShapeWithClearanceToPolygonSet(
|
||||||
|
|
||||||
if( IsMultilineAllowed() )
|
if( IsMultilineAllowed() )
|
||||||
{
|
{
|
||||||
wxPoint pos = GetTextPosition();
|
|
||||||
wxArrayString* list = wxStringSplit( GetText(), '\n' );
|
wxArrayString* list = wxStringSplit( GetText(), '\n' );
|
||||||
wxPoint offset;
|
std::vector<wxPoint> positions;
|
||||||
|
positions.reserve( list->Count() );
|
||||||
|
GetPositionsOfLinesOfMultilineText( positions, list->Count() );
|
||||||
|
|
||||||
offset.y = GetInterline();
|
for( unsigned ii = 0; ii < list->Count(); ii++ )
|
||||||
RotatePoint( &offset, GetOrientation() );
|
|
||||||
|
|
||||||
for( unsigned i = 0; i<list->Count(); i++ )
|
|
||||||
{
|
{
|
||||||
wxString txt = list->Item( i );
|
wxString txt = list->Item( ii );
|
||||||
DrawGraphicText( NULL, NULL, pos, color,
|
DrawGraphicText( NULL, NULL, positions[ii], color,
|
||||||
txt, GetOrientation(), size,
|
txt, GetOrientation(), size,
|
||||||
GetHorizJustify(), GetVertJustify(),
|
GetHorizJustify(), GetVertJustify(),
|
||||||
GetThickness(), IsItalic(),
|
GetThickness(), IsItalic(),
|
||||||
true, addTextSegmToPoly );
|
true, addTextSegmToPoly );
|
||||||
pos += offset;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
delete list;
|
delete list;
|
||||||
|
|
Loading…
Reference in New Issue