SVG lib symbol import: fix AddLine.

This commit is contained in:
Alex Shvartzkop 2023-09-02 19:15:23 +03:00
parent 3bd8ff442d
commit 5bb89b300f
1 changed files with 3 additions and 3 deletions

View File

@ -66,12 +66,12 @@ int GRAPHICS_IMPORTER_LIB_SYMBOL::MapLineWidth( double aLineWidth )
void GRAPHICS_IMPORTER_LIB_SYMBOL::AddLine( const VECTOR2D& aOrigin, const VECTOR2D& aEnd,
double aWidth, const COLOR4D& aColor )
{
std::unique_ptr<LIB_SHAPE> line = std::make_unique<LIB_SHAPE>( m_symbol, SHAPE_T::SEGMENT );
std::unique_ptr<LIB_SHAPE> line = std::make_unique<LIB_SHAPE>( m_symbol, SHAPE_T::POLY );
line->SetUnit( m_unit );
line->SetFillColor( aColor );
line->SetStroke( STROKE_PARAMS( MapLineWidth( aWidth ), PLOT_DASH_TYPE::SOLID ) );
line->SetStart( MapCoordinate( aOrigin ) );
line->SetEnd( MapCoordinate( aEnd ) );
line->AddPoint( MapCoordinate( aOrigin ) );
line->AddPoint( MapCoordinate( aEnd ) );
// Skip 0 len lines:
if( line->GetStart() == line->GetEnd() )