Fix arcs in legacy symbol libs.

This commit is contained in:
Alex Shvartzkop 2024-05-08 18:25:50 +03:00
parent 1bde100ff7
commit 8d13e0ea78
1 changed files with 8 additions and 8 deletions

View File

@ -877,10 +877,10 @@ SCH_SHAPE* SCH_IO_KICAD_LEGACY_LIB_CACHE::loadArc( LINE_READER& aReader )
{
VECTOR2I arcStart, arcEnd;
arcStart.x = schIUScale.MilsToIU( parseInt( aReader, line, &line ) );
arcStart.y = -schIUScale.MilsToIU( parseInt( aReader, line, &line ) );
arcEnd.x = schIUScale.MilsToIU( parseInt( aReader, line, &line ) );
arcEnd.y = -schIUScale.MilsToIU( parseInt( aReader, line, &line ) );
arcStart.x = schIUScale.MilsToIU( parseInt( aReader, line, &line ) );
arcStart.y = -schIUScale.MilsToIU( parseInt( aReader, line, &line ) );
arc->SetStart( arcStart );
arc->SetEnd( arcEnd );
@ -892,10 +892,10 @@ SCH_SHAPE* SCH_IO_KICAD_LEGACY_LIB_CACHE::loadArc( LINE_READER& aReader )
VECTOR2I arcStart( radius, 0 );
VECTOR2I arcEnd( radius, 0 );
RotatePoint( arcStart, EDA_ANGLE( -angle1, EDA_ANGLE_T::TENTHS_OF_A_DEGREE_T ) );
RotatePoint( arcStart, EDA_ANGLE( -angle2, EDA_ANGLE_T::TENTHS_OF_A_DEGREE_T ) );
arcStart += arc->GetCenter();
arc->SetStart( arcStart );
RotatePoint( arcEnd, EDA_ANGLE( -angle2, EDA_ANGLE_T::TENTHS_OF_A_DEGREE_T ) );
RotatePoint( arcEnd, EDA_ANGLE( -angle1, EDA_ANGLE_T::TENTHS_OF_A_DEGREE_T ) );
arcEnd += arc->GetCenter();
arc->SetEnd( arcEnd );
}
@ -909,9 +909,9 @@ SCH_SHAPE* SCH_IO_KICAD_LEGACY_LIB_CACHE::loadArc( LINE_READER& aReader )
*/
if( !MapAnglesV6( &angle1, &angle2 ) )
{
VECTOR2I temp = arc->GetStart();
arc->SetStart( arc->GetEnd() );
arc->SetEnd( temp );
VECTOR2I temp = arc->GetEnd();
arc->SetEnd( arc->GetStart() );
arc->SetStart( temp );
}
return arc;
@ -1623,7 +1623,7 @@ void SCH_IO_KICAD_LEGACY_LIB_CACHE::saveArc( SCH_SHAPE* aArc, OUTPUTFORMATTER& a
EDA_ANGLE startAngle, endAngle;
aArc->CalcArcAngles( startAngle, endAngle );
aArc->CalcArcAngles( endAngle, startAngle );
startAngle.Normalize180();
endAngle.Normalize180();