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() );
@ -737,7 +736,7 @@ void DRAWSEGMENT::SetPolyPoints( const std::vector<wxPoint>& 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<wxPoint> DRAWSEGMENT::GetPolyPoints() const
{
std::vector<wxPoint> 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;

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