Commit ee3e97e6 authored by Nick Østergaard's avatar Nick Østergaard Committed by jean-pierre charras
Browse files

Fix vertical offset for multiline text in VRML exporter.

parent 5f65d0da
Loading
Loading
Loading
Loading
+19 −21
Original line number Diff line number Diff line
@@ -600,33 +600,31 @@ static void export_vrml_pcbtext( MODEL_VRML& aModel, TEXTE_PCB* text )
    if( text->IsMirrored() )
        NEGATE( size.x );

    EDA_COLOR_T color = BLACK;  // not actually used, but needed by DrawGraphicText

    if( text->IsMultilineAllowed() )
    {
        wxPoint pos = text->GetTextPosition();
        wxArrayString* list = wxStringSplit( text->GetText(), '\n' );
        wxPoint offset;

        offset.y = text->GetInterline();

        RotatePoint( &offset, text->GetOrientation() );
        std::vector<wxPoint> positions;
        positions.reserve( list->Count() );
        text->GetPositionsOfLinesOfMultilineText( positions, list->Count() );

        for( unsigned i = 0; i<list->Count(); i++ )
        for( unsigned ii = 0; ii < list->Count(); ii++ )
        {
            wxString txt = list->Item( i );
            DrawGraphicText( NULL, NULL, pos, BLACK,
            wxString txt = list->Item( ii );
            DrawGraphicText( NULL, NULL, positions[ii], color,
                             txt, text->GetOrientation(), size,
                             text->GetHorizJustify(), text->GetVertJustify(),
                             text->GetThickness(), text->IsItalic(),
                             true,
                             vrml_text_callback );
            pos += offset;
        }

        delete (list);
    }
    else
    {
        DrawGraphicText( NULL, NULL, text->GetTextPosition(), BLACK,
        DrawGraphicText( NULL, NULL, text->GetTextPosition(), color,
                         text->GetText(), text->GetOrientation(), size,
                         text->GetHorizJustify(), text->GetVertJustify(),
                         text->GetThickness(), text->IsItalic(),