Fix eeschema crash when saving LIB_BEZIER objects

This commit is contained in:
Maciej Suminski 2017-08-22 13:29:46 +02:00
parent 93e8433412
commit d4fddf1929
2 changed files with 4 additions and 5 deletions

View File

@ -47,6 +47,7 @@ static inline double sqrt_len( int dx, int dy )
void BEZIER_POLY::GetPoly( std::vector<wxPoint>& aOutput )
{
wxCHECK( !m_ctrlPts.empty(), /* void */ );
m_output = &aOutput;
m_output->clear();
m_output->push_back( wxPoint( m_ctrlPts.front() ) );

View File

@ -42,7 +42,7 @@
#include <transform.h>
LIB_BEZIER::LIB_BEZIER( LIB_PART* aParent ) :
LIB_BEZIER::LIB_BEZIER( LIB_PART* aParent ) :
LIB_ITEM( LIB_BEZIER_T, aParent )
{
m_Fill = NO_FILL;
@ -58,10 +58,8 @@ bool LIB_BEZIER::Save( OUTPUTFORMATTER& aFormatter )
aFormatter.Print( 0, "B %d %d %d %d", ccount, m_Unit, m_Convert, m_Width );
for( unsigned i = 0; i < GetCornerCount(); i++ )
{
aFormatter.Print( 0, " %d %d", m_BezierPoints[i].x, m_BezierPoints[i].y );
}
for( const auto& pt : m_BezierPoints )
aFormatter.Print( 0, " %d %d", pt.x, pt.y );
aFormatter.Print( 0, " %c\n", fill_tab[m_Fill] );