Eeschema, print and plot: fix arc issue for lib arcs == 180 deg

Fixes #12502
https://gitlab.com/kicad/code/kicad/issues/12502
This commit is contained in:
jean-pierre charras 2022-09-24 10:00:21 +02:00
parent dcfcfd5f29
commit a9d31348b1
1 changed files with 4 additions and 2 deletions

View File

@ -167,7 +167,8 @@ void LIB_SHAPE::Plot( PLOTTER* aPlotter, bool aBackground, const VECTOR2I& aOffs
// N.B. The order of evaluation is critical here as MapAngles will modify t1, t2
// and the Normalize routine depends on these modifications for the correct output
bool transformed = aTransform.MapAngles( &t1, &t2 );
bool transformed2 = ( ( t1 - t2 ).Normalize180() > ANGLE_0 );
EDA_ANGLE arc_angle = ( t1 - t2 ).Normalize180();
bool transformed2 = ( arc_angle > ANGLE_0 ) && ( arc_angle < ANGLE_180 );
if( transformed != transformed2 )
std::swap( start, end );
@ -329,7 +330,8 @@ void LIB_SHAPE::print( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset
// N.B. The order of evaluation is critical here as MapAngles will modify t1, t2
// and the Normalize routine depends on these modifications for the correct output
bool transformed = aTransform.MapAngles( &t1, &t2 );
bool transformed2 = ( ( t1 - t2 ).Normalize180() > ANGLE_0 );
EDA_ANGLE arc_angle = ( t1 - t2 ).Normalize180();
bool transformed2 = ( arc_angle > ANGLE_0 ) && ( arc_angle < ANGLE_180 );
if( transformed == transformed2 )
std::swap( pt1, pt2 );