Fix and issue about 180 deg arcs in symbols from "old" libraries.

Can be seen with lib version 20201005, not with latest version.
The fix is similar to commit 8a17fb8d, but for arcs defined by start, end, angles
(modify 180 deg arcs)
Fixes #11130
https://gitlab.com/kicad/code/kicad/issues/11130
This commit is contained in:
jean-pierre charras 2022-03-15 11:31:58 +01:00
parent b10f774dc4
commit 1f5ec30566
1 changed files with 15 additions and 0 deletions

View File

@ -1041,6 +1041,21 @@ LIB_SHAPE* SCH_SEXPR_PARSER::parseArc()
*/
arc->SetStart( endPoint );
arc->SetEnd( startPoint );
// Like previously, 180 degrees arcs that create issues are just modified
// to be < 180 degrees to do not break some other functions ( Draw, Plot, HitTest)
EDA_ANGLE arc_start, arc_end, arc_angle;
arc->CalcArcAngles( arc_start, arc_end );
arc_angle = arc_end - arc_start;
if( arc_angle == ANGLE_180 )
{
arc->SetStart( startPoint );
arc->SetEnd( endPoint );
VECTOR2I new_center = CalcArcCenter( arc->GetStart(), arc->GetEnd(),
EDA_ANGLE( 179.5, DEGREES_T ) );
arc->SetCenter( new_center );
}
}
else
{