Handle malformed lines in dragCornerInternal

Fixes https://gitlab.com/kicad/code/kicad/-/issues/7398
This commit is contained in:
Jon Evans 2021-02-03 20:54:49 -05:00
parent f7e21682ec
commit 721bf82603
1 changed files with 7 additions and 1 deletions

View File

@ -449,7 +449,13 @@ SHAPE_LINE_CHAIN dragCornerInternal( const SHAPE_LINE_CHAIN& aOrigin, const VECT
int i;
int d = 2;
if( aOrigin.SegmentCount() == 1)
wxASSERT( aOrigin.PointCount() > 0 );
if( aOrigin.PointCount() == 1 )
{
return DIRECTION_45().BuildInitialTrace( aOrigin.CPoint( 0 ), aP );
}
else if( aOrigin.SegmentCount() == 1 )
{
DIRECTION_45 dir( aOrigin.CPoint( 0 ) - aOrigin.CPoint( 1 ) );