Fix the order of evaluation in the arc printing

MapAngles will adjust by small amounts the angles t1 and t2.  This
adjustment will determine the CW/CCW drawing.  Therefore, the MapAngles
needs to be called explicitly before the Normalize180() call.
Left-to-Right evaluation is not a given for MSVC

Fixes https://gitlab.com/kicad/code/kicad/issues/11050
This commit is contained in:
Seth Hillbrand 2022-03-07 16:41:26 -08:00
parent d39127cac7
commit c9fb95b888
1 changed files with 6 additions and 1 deletions

View File

@ -265,7 +265,12 @@ void LIB_SHAPE::print( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset
CalcArcAngles( t1, t2 );
if( aTransform.MapAngles( &t1, &t2 ) == ( ( t1 - t2 ).Normalize180() > ANGLE_0 ) )
// 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 );
if( transformed == transformed2 )
std::swap( pt1, pt2 );
}