EEschema polylines aren't closed.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18262
This commit is contained in:
@@ -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 );
|
||||
}
|
||||
|
||||
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user