Fix crash when converting selected EDGE_MODULE items to a custom pad.
This commit is contained in:
parent
8ba11dbd68
commit
0b1eb5695f
|
@ -417,7 +417,6 @@ const EDA_RECT DRAWSEGMENT::GetBoundingBox() const
|
||||||
{
|
{
|
||||||
wxPoint pt ( iter->x, iter->y );
|
wxPoint pt ( iter->x, iter->y );
|
||||||
|
|
||||||
|
|
||||||
if( module ) // Transform, if we belong to a module
|
if( module ) // Transform, if we belong to a module
|
||||||
{
|
{
|
||||||
RotatePoint( &pt, module->GetOrientation() );
|
RotatePoint( &pt, module->GetOrientation() );
|
||||||
|
@ -748,10 +747,13 @@ const std::vector<wxPoint> DRAWSEGMENT::GetPolyPoints() const
|
||||||
{
|
{
|
||||||
std::vector<wxPoint> rv;
|
std::vector<wxPoint> rv;
|
||||||
|
|
||||||
|
if( m_Poly.VertexCount() > 0 )
|
||||||
|
{
|
||||||
for ( auto iter = m_Poly.CIterate(); iter; iter++ )
|
for ( auto iter = m_Poly.CIterate(); iter; iter++ )
|
||||||
{
|
{
|
||||||
rv.push_back( wxPoint( iter->x, iter->y ) );
|
rv.push_back( wxPoint( iter->x, iter->y ) );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
|
@ -410,9 +410,7 @@ int MODULE_EDITOR_TOOLS::CreatePadFromShapes( const TOOL_EVENT& aEvent )
|
||||||
shape.m_Radius = em->GetRadius();
|
shape.m_Radius = em->GetRadius();
|
||||||
shape.m_Thickness = em->GetWidth();
|
shape.m_Thickness = em->GetWidth();
|
||||||
shape.m_ArcAngle = em->GetAngle();
|
shape.m_ArcAngle = em->GetAngle();
|
||||||
|
shape.m_Poly = em->GetPolyPoints();
|
||||||
for ( auto p : em->GetPolyPoints() )
|
|
||||||
shape.m_Poly.push_back(p);
|
|
||||||
|
|
||||||
shapes.push_back(shape);
|
shapes.push_back(shape);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue