diff --git a/eeschema/sch_shape.cpp b/eeschema/sch_shape.cpp index 9d4f0699a7..30f500e986 100644 --- a/eeschema/sch_shape.cpp +++ b/eeschema/sch_shape.cpp @@ -578,7 +578,10 @@ void SCH_SHAPE::AddPoint( const VECTOR2I& aPosition ) if( GetShape() == SHAPE_T::POLY ) { if( m_poly.IsEmpty() ) + { m_poly.NewOutline(); + m_poly.Outline( 0 ).SetClosed( false ); + } m_poly.Outline( 0 ).Append( aPosition, true ); } diff --git a/eeschema/tools/ee_point_editor.cpp b/eeschema/tools/ee_point_editor.cpp index 109c93f4ec..66ee6eb359 100644 --- a/eeschema/tools/ee_point_editor.cpp +++ b/eeschema/tools/ee_point_editor.cpp @@ -1272,7 +1272,19 @@ int EE_POINT_EDITOR::removeCorner( const TOOL_EVENT& aEvent ) commit.Modify( shape, m_frame->GetScreen() ); - poly.Remove( getEditedPointIndex() ); + int idx = getEditedPointIndex(); + int last = (int) poly.GetPointCount() - 1; + + if( idx == 0 && poly.GetPoint( 0 ) == poly.GetPoint( last ) ) + { + poly.Remove( idx ); + poly.SetPoint( last-1, poly.GetPoint( 0 ) ); + } + else + { + poly.Remove( idx ); + } + setEditedPoint( nullptr ); updateItem( shape, true );