EEschema polylines aren't closed.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18262
This commit is contained in:
Jeff Young
2024-07-08 14:27:25 +01:00
parent 0682987eb9
commit 5c22162d85
2 changed files with 16 additions and 1 deletions
+3
View File
@@ -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 );
}
+13 -1
View File
@@ -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 );