Fix crash when converting selected EDGE_MODULE items to a custom pad.

This commit is contained in:
jean-pierre charras 2017-10-21 12:46:59 +02:00
parent 8ba11dbd68
commit 0b1eb5695f
2 changed files with 7 additions and 7 deletions

View File

@ -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() );
@ -748,10 +747,13 @@ const std::vector<wxPoint> DRAWSEGMENT::GetPolyPoints() const
{
std::vector<wxPoint> rv;
if( m_Poly.VertexCount() > 0 )
{
for ( auto iter = m_Poly.CIterate(); iter; iter++ )
{
rv.push_back( wxPoint( iter->x, iter->y ) );
}
}
return rv;
}

View File

@ -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);