diff --git a/pcbnew/class_drawsegment.cpp b/pcbnew/class_drawsegment.cpp index 8c6a6951ba..82c133a187 100644 --- a/pcbnew/class_drawsegment.cpp +++ b/pcbnew/class_drawsegment.cpp @@ -417,7 +417,6 @@ const EDA_RECT DRAWSEGMENT::GetBoundingBox() const { wxPoint pt ( iter->x, iter->y ); - if( module ) // Transform, if we belong to a module { RotatePoint( &pt, module->GetOrientation() ); @@ -737,7 +736,7 @@ void DRAWSEGMENT::SetPolyPoints( const std::vector& aPoints ) { m_Poly.RemoveAllContours(); m_Poly.NewOutline(); - + for ( auto p : aPoints ) { m_Poly.Append( p.x, p.y ); @@ -748,9 +747,12 @@ const std::vector DRAWSEGMENT::GetPolyPoints() const { std::vector rv; - for ( auto iter = m_Poly.CIterate(); iter; iter++ ) + if( m_Poly.VertexCount() > 0 ) { - rv.push_back( wxPoint( iter->x, iter->y ) ); + for ( auto iter = m_Poly.CIterate(); iter; iter++ ) + { + rv.push_back( wxPoint( iter->x, iter->y ) ); + } } return rv; diff --git a/pcbnew/tools/module_editor_tools.cpp b/pcbnew/tools/module_editor_tools.cpp index d6afbde0c4..63951e39db 100644 --- a/pcbnew/tools/module_editor_tools.cpp +++ b/pcbnew/tools/module_editor_tools.cpp @@ -410,9 +410,7 @@ int MODULE_EDITOR_TOOLS::CreatePadFromShapes( const TOOL_EVENT& aEvent ) shape.m_Radius = em->GetRadius(); shape.m_Thickness = em->GetWidth(); shape.m_ArcAngle = em->GetAngle(); - - for ( auto p : em->GetPolyPoints() ) - shape.m_Poly.push_back(p); + shape.m_Poly = em->GetPolyPoints(); shapes.push_back(shape);