Fix Bezier reading in schematic as well.

This commit is contained in:
Alex Shvartzkop 2024-01-15 20:31:12 +03:00
parent ad7258721b
commit 01e88d33aa
1 changed files with 13 additions and 3 deletions

View File

@ -3909,7 +3909,10 @@ SCH_SHAPE* SCH_IO_KICAD_SEXPR_PARSER::parseSchBezier()
switch( token )
{
case T_pts:
for( token = NextTok(); token != T_RIGHT; token = NextTok() )
{
int ii = 0;
for( token = NextTok(); token != T_RIGHT; token = NextTok(), ++ii )
{
if( token != T_LEFT )
Expecting( T_LEFT );
@ -3919,11 +3922,18 @@ SCH_SHAPE* SCH_IO_KICAD_SEXPR_PARSER::parseSchBezier()
if( token != T_xy )
Expecting( "xy" );
bezier->AddPoint( parseXY() );
switch( ii )
{
case 0: bezier->SetStart( parseXY() ); break;
case 1: bezier->SetBezierC1( parseXY() ); break;
case 2: bezier->SetBezierC2( parseXY() ); break;
case 3: bezier->SetEnd( parseXY() ); break;
default: Unexpected( "control point" ); break;
}
NeedRIGHT();
}
}
break;
case T_stroke: